main()
{
int x=10,y=15;
x=x++;
y=++y;
printf("%d %d\n",x,y);
}

output??

Answers were Sorted based on User's Feedback



main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output??..

Answer / madhu

hey how come 15 ....
ans is 11,16

Is This Answer Correct ?    5 Yes 7 No

main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output??..

Answer / sateesndaruh varma ba

x=x++ it means the x value is first assignto x and then increment by 1

so here in this given value of x=10
it become" x= 11" in output

y=++y it means pre increment so first y value is incremented and than it will assignto y

finally y=16

Is This Answer Correct ?    2 Yes 5 No

main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output??..

Answer / daya

11 16

Is This Answer Correct ?    2 Yes 5 No

main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output??..

Answer / ankit

11 16 is correct ..
value of x is incremented and is saved in memeory and at
the time of display it will be 11,
as in case of y it will be incremented and will store the
incremented value to be displayed for y.

Is This Answer Correct ?    0 Yes 3 No

main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output??..

Answer / sheikh rasel

11

15

Is This Answer Correct ?    2 Yes 10 No

main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output??..

Answer / nirmala

11,15

Is This Answer Correct ?    3 Yes 19 No

main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output??..

Answer / rasel

11 15

Is This Answer Correct ?    0 Yes 16 No

main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output??..

Answer / kalai

10,15

Is This Answer Correct ?    1 Yes 22 No

main() { int x=10,y=15; x=x++; y=++y; printf("%d %d\n",x,y); } output??..

Answer / mannucse

35 39

Is This Answer Correct ?    6 Yes 48 No

Post New Answer

More C Interview Questions

Write a program to compute the following 1!+2!+...n!

4 Answers  


1.find the second maximum in an array? 2.how do you create hash table in c? 3.what is hash collision

9 Answers   HCL, Qualcomm,


#include main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }

6 Answers   ME,


What is the Lvalue and Rvalue?

2 Answers  


what is d pitfalls of registers variables

3 Answers   TCS,






Explain what is the difference between declaring a variable and defining a variable?

1 Answers  


How do you list files in a directory?

0 Answers  


Explain what is page thrashing?

0 Answers  


What is the best way of making my program efficient?

0 Answers  


wap in c to accept a number display the total count of digit

4 Answers  


here is a link to download Let_Us_C_-_Yashwant_Kanetkar

3 Answers   Microsoft,


What is the output of following program ? int main() { int x = 5; printf("%d %d %d\n", x, x << 2, x >> 2); }

5 Answers   Amazon, Qualcomm,


Categories