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
Wt are the Buses in C Language
What is wrong in this statement?
How can I find out how much free space is available on disk?
How can I insert or delete a line (or record) in the middle of a file?
What is a list in c?
Explain what are reserved words?
List a few unconditional control statement in c.
What does emoji p mean?
What is the function of this pointer?
What are local static variables?
Explain how can I convert a string to a number?
How is = symbol different from == symbol in c programming?
what is the function of pragma directive in c?
When reallocating memory if any other pointers point into the same piece of memory do you have to readjust these other pointers or do they get readjusted automatically?
Is it fine to write void main () or main () in c?