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 does the characters “r” and “w” mean when writing programs that will make use of files?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?
How to get string length of given string in c?
List some basic data types in c?
Explain what is the heap?
Why c is known as a mother language?
What does c mean in basketball?
Can you think of a logic behind the game minesweeper.
What is the main difference between calloc () and malloc ()?
What is a void pointer in c?
What should malloc(0) do?
You are to write your own versions of strcpy() and strlen (). Call them mystrcpy() and mystrlen(). Write them first as code within main(), not as functions, then, convert them to functions. You will pass two arrays to the function in the case of mystrcpy(), the source and target array.
Why c language is called c?
Explain how do you list files in a directory?
How can you check to see whether a symbol is defined?