What will be the output of the following program
#include<stdio.h>
void main()
{
int i=20;
i-=i+++++i++;
printf("%d",i);
}
Answers were Sorted based on User's Feedback
Answer / suji
THE PROGRAM DOES NOT RETURN ANY THING.. IT WILL SHOW THE ERROR
| Is This Answer Correct ? | 10 Yes | 2 No |
Answer / shajitha
Answer will be 42.
i++ =20
i+++=20+
i+++++i=20+22
i+++++i++=42
| Is This Answer Correct ? | 7 Yes | 6 No |
Answer / j mahesh
i=20
i++ + ++i =20 + 21=41
i-=41
i=i-41 =20-41
i= -21
| Is This Answer Correct ? | 4 Yes | 4 No |
Answer / anil kumar singh
this program depend on compiler dos turbo3 cpp
error msg:Lvalue required
| Is This Answer Correct ? | 0 Yes | 1 No |
What is a class?
program to find which character is occured more times in a string and how many times it has occured? for example in the sentence "i love india" the output should be i & 3.
Can I initialize unions?
in b=6.6/a+(2*a+(3*c)/a*d)/(2/n); which operation will be performed first a) 6.6/a b) 2*a c) 3*c d) 2/n
Is c an object oriented programming language?
what will be the output of this program........ main() { int a=2,b=4,c=6; printf("%d"); } why it gives the value of third variable.
What is the use of function in c?
the expression a=30*1000+2768; evalutes to a) 32768 b) -32768 c) 113040 d) 0
What is line in c preprocessor?
void main() { //char ch; unsigned char ch; clrscr(); for(ch =0;ch<= 127; ch++) printf(" %c= %d \t ", ch, ch); } output?
What is malloc calloc and realloc in c?
why return type of main is not necessary in linux