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
What is pragma in c?
What are local static variables? How can you use them?
How can I invoke another program or command and trap its output?
Explain what standard functions are available to manipulate strings?
How do you print only part of a string?
What is string concatenation in c?
Write a code to determine the total number of stops an elevator would take to serve N number of people.
What are header files in c?
List some applications of c programming language?
Explain how do you print only part of a string?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
How can you find out how much memory is available?
What is const volatile variable in c?
What is p in text message?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3