Quiz for C (Iteration Statements/Loops)
Q.1 How many different loops are there in C ?
Q.2 Which of the following is a also known exit-control loop in C ?
Q.3 Is the syntax for, 'for' loop given below is correct ?
for(;i<=4;)
{
//Statements
}
Q.4 Which loop will always execute some line codes even if the condition is not true ?
Q.5 Writing multiple conditions is allowed in which type of loop ?
Q.6 Which loops are known as Entry Control Loop ?
Q.7 What will be the output of this code snippet below:
#include<stdio.h>
void main()
{
int a = 5;
do
{
printf("%d ", a++);
} while (a<=10);
}
Q.8 What will be the output of this code ?
#include <stdio.h>
int main()
{
int i, n;
n = 10;
for (i = 1; i < n; i++)
{
if (i % 2 != 0)
{
printf("%d ", i);
}
}
return 0;
}
Q.9 Predict the output of the following Code.
#include <stdio.h>
void main()
{
int i = 5;
while (i-- >= 0)
printf("%d,", i);
i = 5;
printf(" ");
while (i-- >= 0)
printf("%i,", i);
while (i-- >= 0)
printf("%d,", i);
}
Q.10 What will be the output of the given Code Snip ?
#include <stdio.h>
void main()
{
char j = 1;
while(j<5)
{
printf("%d", j);
j=j+1;
}
printf(" ");
}
Q.11 Loops are also called as Iteration Statements in C.
Q.12 What will be the output of the given Code Snip.
#include <stdio.h>
void main()
{
int = 0;
for (i<=5 && i>=-1 ; ++i; i>0)
{
printf("%d",i);
}
}
Q.13 Guess the Output of the follwing Code.
#include <stdio.h>
void main()
{
int i = 65535;
while (i++ != 0)
printf("%d", ++i);
printf(" ");
}
Q.14 Can we use a do while loop inside a for loop ?
Q.15 Predict the Output of the below Code.
#include <stdio.h>
typedef enum
{
F,
T
} boolean;
void main()
{
boolean condition = T;
do
{
printf("Help For Coders !");
} while (condition);
}
Instructions:-
- This Quiz is based on the basic concepts of C.
- Each correct answer will carry 2 points.
- The time limit for this Quiz is 600 seconds i.e. 10 minutes.
- The timer will start immediately after clicking on the start button.
- Once an option is selected you cannot select any other, So choose wisely.
- Do not refresh the page as it will reset the quiz.
- Once the time is up the quiz will automatically get submitted with number of Questions responded.
- Your total score alongwith your name will be displayed after submission of the Quiz.
- Wish you ALL THE BEST. 👍👍
START
Post a Comment
FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP