void main()
{
char c;
while(c=getchar()!='\n')
printf("%d",c);
}
o/p=11 why?
Answer Posted / sumeet saini
It says %d which means it prints integer value. If we want to print character we need to write %c. So the answer is right. If we replace %d with %c . This program will print what ever character we hit from keyboard until we press enter
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
Is javascript based on c?
What are the advantages of using new operator as compared to the function malloc ()?
What does void main return?
Which of these functions is safer to use : fgets(), gets()? Why?
What is keyword with example?
What is an auto keyword in c?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
How many main () function we can have in a project?
When should a far pointer be used?
How can I read/write structures from/to data files?
What is the purpose of the preprocessor directive error?
What is a structure and why it is used?
What is .obj file in c?
Is printf a keyword?