void main()
{
char c;
while(c=getchar()!='\n')
printf("%d",c);
}
o/p=11 why?
Answer Posted / prashant
The answer would have been 11 only if the while statement would have had a semicolon to finish with , i.e. "while(c=getchar()!='\n');" According to the above code it will generate the ascii of all the characters entered except the newline character.
Regards
Prashant
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
Explain enumerated types in c language?
What is LINKED LIST? How can you access the last element in a linked list?
What is the difference between struct and union in C?
What is the purpose of void pointer?
What is the purpose of type declarations?
What is property type c?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
What is the maximum no. of arguments that can be given in a command line in C.?
What is modeling?
How can I read data from data files with particular formats?
What are the application of c?
What does c value mean?
the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function
What is %g in c?