top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

Write a unix command to display the every character in the word "QUERYHOME" in new line.

0 votes
77 views

Write a unix command to display the every character in the word "QUERYHOME" in new line.

Ex : Input - QUERYHOME
output: Q
U
E
R
Y
H
O
M
E

posted Jun 29, 2016 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes
#include<stdio.h>
main()
{
        char *p="QUERYHOME";
        while(*p)
                printf("%c\n",*p++);
}
answer Jun 30, 2016 by Chirag Gangdev
The guy asked for unix command
Sir, I think,
There is no such command to do that, He can compile this code and create his own command.
I think we can use mix of sed or fold and echo something like
$ echo "QUERYHOME" | sed -e 's/\(.\)/\1 /g' | tr ' ' '\n'
$ echo "QUERYHOME" | fold -w 1

This works perfect on command-line..
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...