¦void main()
¦{
¦int i=10,j;
¦ j=i+++i+++i;
¦printf("%d",j);
¦getch();
¦}
¦ output:-30
but in same question if we write as-
¦void main()
¦{
¦int i=10;
¦ int j=i+++i+++i;
¦printf("%d",j);
¦getch();
¦}
¦ output:-33
why output is changed from 30 to 33. Can any body answer...
Answers were Sorted based on User's Feedback
ithink cannot use void in main().becoz returns integer. and output of this 2 program is 30 only.not print 33
Is This Answer Correct ? | 2 Yes | 3 No |
Answer / abhishek kumar
this question is itself is confusing question as if we
compile it with c,c++ compiler, the compiler itself get
confuse and it take i=10 all time as it does not make
distinguish between operator in expression(i+++i+++i) and
give output as 30, but if we compile it with java compiler
it output is 33, as java compiler make distinguish between
operator as (i++ +i+ ++i).
so my conclusion is that question given above is confusing
itself that why output are varying every time.
Is This Answer Correct ? | 1 Yes | 3 No |
Write a program that produces these three columns sequence nos. using loop statement Sequence nos. Squared Squared + 5 1 1 6 2 4 9 3 9 14 4 16 21 5 25 30
What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }
main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }
main() { extern out; printf("%d", out); } int out=100;
plz send me all data structure related programs
Finding a number multiplication of 8 with out using arithmetic operator
program to Reverse a linked list
12 Answers Aricent, Microsoft, Ness Technologies,
#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }
Write a program to model an exploding firecracker in the xy plane using a particle system
int main() { int x=10; printf("x=%d, count of earlier print=%d", x,printf("x=%d, y=%d",x,--x)); getch(); } ================================================== returns error>> ld returned 1 exit status =================================================== Does it have something to do with printf() inside another printf().
what is the code of the output of print the 10 fibonacci number series
/*what is the output for*/ void main() { int r; printf("Naveen"); r=printf(); getch(); }