Cquiz 3
Cquiz 3
Cquiz 3
Help
Simran Meena (69316)
Summary
Summary of your recent exam
Result: Fail
Marks: 6/30
Percentage: 0.00 %
Questions: 10
Correct Answers: 2
Attempted: 8
1. Find the output of the following code:
int main()
{
int n=1;
for(printf("Step 1 \t");printf("Step 2\t"),n--;printf("Step 4\t"))
{
printf("Step 3\t");
}
}
2. What will be the output of the following code?
#include<stdio.h>
int main() {
int i = -3, j = 0;
while (i <= 3, j < 10) {
if (i >= 0)
break;
else {
i++;
j++;
}
printf("%d, %d\n", i, j);
continue;
}
printf("\nSunbeam");
return 0;
}
Answers
4. #include <stdio.h>
void main()
{
int i=1;
while (i<=5)
{
printf("%d",i);
if (i==5)
goto print;
i++;
}
}
Answers
1. Hello world
2. Error (ans
3. 5 4 3 2 1
4. 0 1 2 3 4
7. void main()
{
while(1){
if(printf("%d",printf("%d")))
break;
else
continue;
}
}
Answers
1. 1
2. Infinite loop
3. Garbage value (ans
4. 0
9. #include <stdio.h>
int main()
{
int i = 0, j = 0;
while (i<5,j<10)
{
i++;
j++;
}
printf("%d %d", i, j);
}
Answers
1. 5 5
2. syntax error
3. 5 10
4. 10 10 (ans