What will be output if you will execute following c code?
- 10 3
- 11 3
- 10 5
- Compilation error
- Run Time Error
Correct answer
Explanation:
Consider on expression: + +a
Here both + are unary plus operation. So
= + +a+ + +a+ + +5;
= + +3+ + +3+ + 5
= 3+ 3+ 5
= 11
Note: Increment operator ++ cannot have space between two plus symbols.
Here both + are unary plus operation. So
= + +a+ + +a+ + +5;
= + +3+ + +3+ + 5
= 3+ 3+ 5
= 11
Note: Increment operator ++ cannot have space between two plus symbols.
0 comments:
Post a Comment