
C Programming Quiz
Authored by Ebenesar J
Computers
12th Grade - University
Used 720+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 5;
if (x < 1)
printf("hello");
if (x == 5)
printf("hi");
else
printf("no");
}
hi
hello
no
error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 0;
if (x == 1)
if (x == 0)
printf("inside if\n");
else
printf("inside else if\n");
else
printf("inside else\n");
}
inside if
inside else if
inside else
compile time error
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int x = 0;
if (x == 1)
if (x >= 0)
printf("true\n");
else
printf("false\n");
}
Depends on the compiler
No print statement
True
False
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
The switch statement takes a given integer value then seeks a matching value among a number of _______ statements.
break
case
switch
goto
5.
MULTIPLE CHOICE QUESTION
5 sec • 1 pt
How many loops are there in C
1
3
2
4
6.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Which of the following is an exit control statement
for
while
do while
continue
7.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
The value of i after the execution of the following segment is
i = 2;
for( i=0; i>10; i=i+1);
1
2
0
11
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?