C Quiz
C Quiz
Instructions: Write only the output for the question number 1 to 5 and the remaining questions (no. 6 to 15)
are of MCQ type so tick the correct option.
{
1. #include <stdio.h> for (j = 0; j < 1; )
int main() { {
int i; break;
for(i = 1; i <= 10; i++) { }
if(i % 2 == 0) { printf(“C lab”);
}
printf("%d is even\n", i); }
return 0;
else {printf("%d is odd\n", i);} } }
9. #include<stdio.h>
int main()
{
for (int i = 1; i != 10; i += 2)
{printf(" X ");
}
return 0;
}
What will be the output?
a. X X X X X;
b. X X…infinite times;
c. X X X X ;
d. X X ;
10. When the condition of the do-
while loop is false, how many
times will it execute the code?
a. 4; b. 3;
c. 1; d. 2 ;