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
What are the 5 types of organizational structures?
Explain about the constants which help in debugging?
How many bytes is a struct in c?
how to find binary of number?
How can I do serial ("comm") port I/O?
What is static volatile in c?
What are control structures? What are the different types?
What are the uses of a pointer?
What is optimization in c?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
Tell me when would you use a pointer to a function?
What is use of bit field?
Are pointers integers in c?
Are the variables argc and argv are local to main?
State the difference between x3 and x[3].