What will be output of following c code?
Additional Details
#include <stdio.h>
int main()
{
int x=123;
int i={
printf(“c” “++”)
};
for(x=0;x<=i;x++){
printf(“%x “,x);
}
return 0;
}
What will be the output of following c code
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.
Filed Under: Programming