void main()
{
char c;
while(c=getchar()!='\n')
printf("%d",c);
}
o/p=11 why?

Answer Posted / deepshree sinha

the while loop is continue until the expression is not false.
when the expression is false that is when c='\n' it will come
out from the loop.then it will print c which is equal to '\n'
whose integer value is 11.so it will print 11.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is null always defined as 0(zero)?

604


explain what are pointers?

612


write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.

14946


Can we replace the struct function in tree syntax with a union?

770


What is the total generic pointer type?

718






What are pointers? Why are they used?

625


What is difference between %d and %i in c?

686


Difference between pass by reference and pass by value?

649


How to write c functions that modify head pointer of a linked list?

537


How is = symbol different from == symbol in c programming?

604


What are the scope of static variables?

595


What are global variables and explain how do you declare them?

565


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

1621


How do you determine whether to use a stream function or a low-level function?

636


Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

637