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
How can I remove the leading spaces from a string?
how to find anagram without using string functions using only loops in c programming
Write a program to check whether a number is prime or not using c?
What is character set?
How to write a multi-statement macro?
What is the difference between #include
Explain pointers in c programming?
What is getch c?
What is queue in c?
Explain how can you avoid including a header more than once?
How can I manipulate strings of multibyte characters?
Can we add pointers together?
What is a sequential access file?
What are near, far and huge pointers?
Write program to remove duplicate in an array?