
Looping in C

Quiz
•
Computers
•
University
•
Hard
Dr. Singh
Used 3+ times
FREE Resource
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++;}}
Create a free account and access millions of resources
Similar Resources on Wayground
8 questions
Level 1 - week 1

Quiz
•
7th Grade - University
6 questions
Unit 13 Function and decision

Quiz
•
University
12 questions
C Practice Test 1

Quiz
•
University
12 questions
Printf, scanf

Quiz
•
University
10 questions
ECE-C Quiz _3

Quiz
•
University
6 questions
Unit 12 Inline

Quiz
•
University
15 questions
Quiz Pelatihan Pengenalan Bahasa Pemrograman C Part 1

Quiz
•
12th Grade - University
12 questions
Functions C

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University