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


Please Help Members By Posting Answers For Below Questions

What are # preprocessor operator in c?

619


What is file in c language?

566


What does a function declared as pascal do differently?

595


What is a stream?

636


What language is c written?

567






What is bubble sort in c?

627


What is data structure in c programming?

561


What are identifiers c?

555


what is different between auto and local static? why should we use local static?

630


What is calloc malloc realloc in c?

579


What is volatile variable in c with example?

576


Explain what is page thrashing?

601


we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above

627


what is a NULL Pointer? Whether it is same as an uninitialized pointer?

745


What are the different data types in C?

716