void main()
{
int i=5;
printf("%d",i++ + ++i);
}
Answer Posted / vivers
There are two different questions..
in which its asking the result for
1)(i++ + ++i)
answer will be---> 12
"as addition will takes place from left to right
step1: i++ = 5;
step2: value of i will be updated before taking value of
another operand and hence i = 6;
step3: ++i = 7 as first increment will happen and then value
will be used.
final result: 5 + 7 = 12"
2) (i+++++i)
answer will be---> compile error
"because illegal combination of operators"
best of luck...
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is realloc in c?
What is the purpose of scanf() and printf() functions?
What is the use of header files?
What is structure of c program?
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
Why can’t constant values be used to define an array’s initial size?
What is the purpose of main( ) in c language?
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
What is the use of getch ()?
Is swift based on c?
What are nested functions in c?
What is spaghetti programming?
Why is c called "mother" language?
What are the features of c language?
What are multidimensional arrays?