Q:
What will be output of following c code?
#include <stdio.h>
int main()
{
int x=123;
int i={
printf("c" "++")
};
for(x=0;x<=i;x++){
printf("%x ",x);
}
return 0;
}
Answer
Output: c++0 1 2 3
Explanation: First printf function will print: c++ and return 3 to variable i.For loop will execute three time and printf function will print 0, 1, 2 respectively.
View answer
Workspace
Report Error
Discuss