¦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 |
String reverse with time complexity of n/2 with out using temporary variable.
How we will connect multiple client ? (without using fork,thread)
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };
main() { int i =10, j = 20; clrscr(); printf("%d, %d, ", j-- , --i); printf("%d, %d ", j++ , ++i); } a. 20, 10, 20, 10 b. 20, 9, 20, 10 c. 20, 9, 19, 10 d. 19, 9, 20, 10
how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!
write a c program to Reverse a given string using string function and also without string function
what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);
main() { char *p; printf("%d %d ",sizeof(*p),sizeof(p)); }
write a origram swaoing valu without 3rd variable
void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }
How to count a sum, when the numbers are read from stdin and stored into a structure?
void main () { int x = 10; printf ("x = %d, y = %d", x,--x++); } a. 10, 10 b. 10, 9 c. 10, 11 d. none of the above