Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...



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 / mahendra giri

11 16

Is This Answer Correct ?    136 Yes 33 No

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

Answer / sathya.r

Ans: 10,16

Is This Answer Correct ?    91 Yes 32 No

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

Answer / mazrul

in x=x++;
the above expression is postfix
first we assign 10 into x then increment it by one so value
of x become 11
ic case of
y=++y;
is prefix expression firstly we increment value of y
then assign it to y.
so y become
y=16

Is This Answer Correct ?    53 Yes 17 No

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

Answer / gita

the answer is 10,16.
because x=x++;
means first assign after that that is incremented.
in case of y=++y;
first increment operation is performed. after that assigned.

Is This Answer Correct ?    18 Yes 4 No

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

Answer / rukmanee

output : x=10;
y=16;

Is This Answer Correct ?    20 Yes 7 No

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

Answer / divyansh

output will be 1o 16

Is This Answer Correct ?    12 Yes 1 No

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

Answer / subha raman

the answer is 10 and 16..
in the case of postfix,the value will be displayed first
[that is the difference between postfix and prefix]..
when the main function is again called and the value is
displayed it will b'com..11 and 17..

Is This Answer Correct ?    18 Yes 15 No

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

Answer / neha gupta

according to c standard they are undefined expressions.different compilers interpret answer in different way.

Is This Answer Correct ?    3 Yes 0 No

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

Answer / shruti

the ans is 11 and 16..

y = ++y;

wont make any differance as a statement.

we will have to think about it only if we are using it in
loops.. or conditional statements etc.. :-)

so dont get confused.
dont forget ur basics..

C is a procedural language.
hence

x = x++;
will be completely executed first
the value of x = 11.

and then

y = ++y;
will be executed and value will be changed to 16

Is This Answer Correct ?    11 Yes 11 No

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

Answer / chandrakala

hai Mannu how it will become 35, 39. the answer is only 11
and 16 ok...


thanks
chandra

Is This Answer Correct ?    9 Yes 10 No

Post New Answer

More C Interview Questions

What are pointers really good for, anyway?

0 Answers  


Find the O/p of the following struct node { char *name; int num; }; int main() { struct node s1={"Harry",1331}; struct node s2=s1; if(s1==s2) printf("Same"); else printf("Diff"); }

1 Answers  


Can you explain the four storage classes in C?

0 Answers   TCS,


Why c is a mother language?

0 Answers  


write c program without semicolon

11 Answers   MindTech, TCS, Wipro,


Program to find largest of three numbers without using comparsion operator?

3 Answers  


Is there any book to know about Basics of C Language?

4 Answers  


Which function in C can be used to append a string to another string?

0 Answers  


What is time complexity c?

0 Answers  


What is c language used for?

0 Answers  


how to print 212 as Twohundreds twelve plz provide me ans soon

1 Answers  


write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.

0 Answers   Lovely Professional University,


Categories