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
Linked lists -- can you tell me how to check whether a linked list is circular?
In which layer of the network datastructure format change is done
How can I get back to the interactive keyboard if stdin is redirected?
Is it possible to initialize a variable at the time it was declared?
Are pointers really faster than arrays?
How can I trap or ignore keyboard interrupts like control-c?
How can you be sure that a program follows the ANSI C standard?
Write a program to reverse a linked list in c.
What are header files and explain what are its uses in c programming?
What are types of structure?
Which are low level languages?
differentiate built-in functions and user – defined functions.
What is function in c with example?
Process by which one bit pattern in to another by bit wise operation is?
What is pointer to pointer in c?