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
What are the two types of functions in c?
What is your stream meaning?
What is the difference between array_name and &array_name?
What is the general form of a C program?
What is binary tree in c?
C program to find all possible outcomes of a dice?
a program that can input number of records and can view it again the record
What are the various types of control structures in programming?
Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.
What is void pointers in c?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
How can you increase the size of a dynamically allocated array?
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none