Thursday, 16 August 2012

What will be the output of following c code? | C Programming

#include <stdio.h>
#include <string.h>
int main()
{
inti=0;
for(;i<=2;)
printf(" %d",++i);
return0;
}


A.0 1 2
B. 0 1 2 3
C.. 1 2 3
D. Compiler error
E. Infinite loop

Ans: C

No comments: