void main()
{
char c;
while(c=getchar()!='\n')
printf("%d",c);
}
o/p=11 why?
Answer Posted / hari.11
above friend has posted correct answer,
11 is not the correct answer,
it will take all characters into buffer and will not output any answer until we press '\n' character.
So it would print 1 as many times as number of character pressed before '\n'.
e.g.:
s
o/p: 1
sd
o/p: 11
gdfdd
o/p: 11111
111
o/p: 111
for further queries and discussions, visit..
http://forum.campusmaniac.com/
http://www.campusmaniac.com/
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
If the size of int data type is two bytes, what is the range of signed int data type?
What is #define size in c?
How do I get an accurate error status return from system on ms-dos?
What is a char in c?
What is the difference between far and near ?
What do you mean by keywords in c?
What is #include conio h?
What is && in c programming?
Differentiate between declaring a variable and defining a variable?
What is a structure member in c?
what are the advanced features of functions a) function declaration and prototypes b) calling functions by value or by reference c) recursion d) all the above
What is the purpose of macro in C language?
What are the different categories of functions in c?
How can I remove the trailing spaces from a string?
What does double pointer mean in c?