main()
{
int x=20,y=35;
x = y++ + x++;
y = ++y + ++x;
printf("%d %d\n",x,y);
}
what is the output?
Answer Posted / sagar
here first in x = y++ + x++;
= (35+1) + (20+1);//here value of x is not
= 36 + 21; assigned to 21 as x++
= 57... and 'lly to y++....
now the value of x = 57.
now for y = ++y + ++x;
= (1+35) + (1+57);
= 36 + 58;
= 94...
therefore,after performing all operatioins we get,
x==57 And y==94....
| Is This Answer Correct ? | 6 Yes | 4 No |
Post New Answer View All Answers
Difference between constant pointer and pointer to a constant.
stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.
What is the ANSI C Standard?
How are variables declared in c?
How many types of errors are there in c language? Explain
What is a loop?
explain what are pointers?
How can you access memory located at a certain address?
What is the use of pointers in C?
please give me some tips for the placement in the TCS.
How can you tell whether two strings are the same?
what is the differnce between programing langauge and tool? is sas is a programing langauge r tool?
How do shell structures work?
Is there any algorithm to search a string in link list in the minimum time?(please do not suggest the usual method of traversing the link list)
What is #line used for?