main()
{
int x=20,y=35;
x = y++ + x++;
y = ++y + ++x;
printf("%d %d\n",x,y);
}
Answer Posted / muhammad abdullah
#include<stdio.h>
#include<conio.h>
void main()
{
int x=20,y=35; (comment)//We delcare two variables and initialize them.
clrscr();
x=y++ + x++; (comment) /*As increment operator increases one in the value of variable.The value
of y is 35 and after increment of 1, the value of y will be 36.The value of
x=20 and after increment of 1, the value of x will be 21.Arithmetic operator
(+) adds both the values(36+21=57).So, the value of x=57.*/
y=++y + ++x; (comment) /*The value of y is 35.Due to increment operator the value of
y becomes 36.And we have ever got the value of x as it is x=57. Now,increment
operator add 1 in the value of x and the value of x will be 58.By adding
(36+58=94) we got the final value of y=94.*/
printf("The value of x=%d
The value of y=%d
",x,y);
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Why we use void main in c?
What are the advantages of c preprocessor?
Write a program to print “hello world” without using semicolon?
Does c have class?
how do you programme Carrier Sense Multiple Access
i got 75% in all semester am i eligible for your company
how to count no of words,characters,lines in a paragraph.
Dont ansi function prototypes render lint obsolete?
Is there any demerits of using pointer?
Are the variables argc and argv are local to main?
What does void main return?
What is typeof in c?
How many levels deep can include files be nested?
What is enumerated data type in c?
What is mean by data types in c?