
Looping in C
Authored by Dr. Singh
Computers
University
Used 3+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The C code ‘for(;;)’ represents an infinite loop. It can be terminated by ___________
a break statement
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be printed by the given code ?
#include <stdio.h>
int main()
{ int z = 1;
while (z <= 5)
{ if (z == 3)
{ z++; }
printf("%d ", z);
z++; }
return 0; }
1 2 4 5
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
what will be printed by the following code?
#include<stdio.h>
int main()
{while(1)
{printf("Hello ");}
return 0;
}
Hello is printed once
Run time error
Compile time error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The for statement
for(expr1;expr2;expr3)
{statement;}
is equivalent to
while(expr1 == expr2)
{
statement;
expr3;
}
while(expr1 != expr2)
{
statement;
expr3;
}
expr1;
while(expr2)
{
statement;
expr3;
}
None of the above
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
The code:
#include<stdio.h>
int main()
{int j = 0;
while(j<3)
{j++;
printf("In the loop");}
How many times 'j' value is checked?
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
In which type of loop, the body of the loop is executed at least once
both for and while loop
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output?
#include<stdio.h>
int main()
{ int p=1;
while(p=8)
{ printf("Test ");
p++;}}
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Java Control Flow statements
Quiz
•
University
11 questions
Java Quiz 3 - Array
Quiz
•
University
10 questions
C++ Array Quiz
Quiz
•
University
15 questions
quiz pertemuan 2 asik ddp
Quiz
•
University
15 questions
Computer Science Quiz
Quiz
•
University
10 questions
Quiz 2 - ASD - B
Quiz
•
University
10 questions
DBMS Lab Quiz 1 2B3
Quiz
•
University
10 questions
P1_APLab2Quiz_B3B4
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade