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

Answers were Sorted based on User's Feedback



main() { int i =10, j = 20; clrscr(); printf("%d, %d, ", j-- , --i); ..

Answer / guest

c)

Is This Answer Correct ?    35 Yes 3 No

main() { int i =10, j = 20; clrscr(); printf("%d, %d, ", j-- , --i); ..

Answer / chand

ITS c 20 9 19 10

Is This Answer Correct ?    7 Yes 2 No

main() { int i =10, j = 20; clrscr(); printf("%d, %d, ", j-- , --i); ..

Answer / ramya

for right increment the value not change.
for the left increment the value change.
so j++=20,--i=9,j++=20,++i=10.

Is This Answer Correct ?    0 Yes 1 No

main() { int i =10, j = 20; clrscr(); printf("%d, %d, ", j-- , --i); ..

Answer / manoj singh

b.20,9,20,10

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More C Code Interview Questions

Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

0 Answers   IBM,


main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } a. 2 b. 100 c. 4 d. none of the above

5 Answers   HCL,


What are segment and offset addresses?

2 Answers   Infosys,


find simple interest & compund interest

2 Answers  


main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above

3 Answers   HCL,






how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns

0 Answers  


union u { struct st { int i : 4; int j : 4; int k : 4; int l; }st; int i; }u; main() { u.i = 100; printf("%d, %d, %d",u.i, u.st.i, u.st.l); } a. 4, 4, 0 b. 0, 0, 0 c. 100, 4, 0 d. 40, 4, 0

1 Answers   HCL,


main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }

1 Answers  


union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4

3 Answers   HCL,


#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above

3 Answers   HCL,


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

4 Answers   HCL,


#define assert(cond) if(!(cond)) \ (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\ __FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }

1 Answers  


Categories