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
design and implement a data structure and performs the following operation with the help of file (included 1000 student marks in 5 sub. and %also) 1.how many students are fail in all 5 subjects (if >35) 2. delete all student data those are fail in all 5 subjects. 3. update the grace marks (5 no. if exam paper is 100 marks) 4. arrange the student data in ascending order basis of marks. 5.insert double of deleted students with marks in the list.
Why is it important to memset a variable, immediately after allocating memory to it ?
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
What is an array in c?
What is c system32 taskhostw exe?
What is nested structure with example?
int far *near * p; means
What are the advantages of c preprocessor?
Is it better to use malloc() or calloc()?
Explain what are preprocessor directives?
Which is an example of a structural homology?
Which driver is a pure java driver
What is masking?
What is the difference between struct and typedef struct in c?