
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
Quiz - 1

Quiz
•
University
15 questions
Common errors in C programming

Quiz
•
University
6 questions
PPS MCQ on 22.11.2024

Quiz
•
10th Grade - University
15 questions
Bootcamp Day 3 - Java Array

Quiz
•
University
12 questions
Android App Development

Quiz
•
University
10 questions
Day 7 Assessment -2

Quiz
•
University
12 questions
Lógica Programação

Quiz
•
University
11 questions
C Language

Quiz
•
10th Grade - University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University