Home » Technical Questions » Programming

What will be output of following c code? #include int main() { int x=123; int i={ printf("c" "++") }; for(x=0;x<=i;x++){ printf("%x ",x); } return 0; }

Correct Answer: Output: c++0 1 2 3 Explanation: First printf function will print: c++ and return 3 to variable iFor loop will execute three time and printf function will print 0, 1, 2 respectively

← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion