
C Programming- Control statements
Quiz
•
Professional Development
•
University
•
Practice Problem
•
Hard
Shaik Imam
Used 23+ times
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C code? (Assuming that we have entered the value 1 in the standard input)
#include <stdio.h>
void main()
{
double ch;
printf("enter a value between 1 to 2:");
scanf("%lf", &ch);
switch (ch)
{
case 1:
printf("1");
break;
case 2:
printf("2");
break;
}
}
1
Nothing
Compile time error
2
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 0;
if (x == 0)
printf("hi");
else
printf("how are u");
printf("hello");
}
hello
hi
hihello
how are you
3.
MULTIPLE CHOICE QUESTION
30 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");
}
Nothing
Run time error
Varies
Hello
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include <stdio.h>
void main()
{
char ch;
printf("enter a value between 1 to 2:");
scanf("%c", &ch);
switch (ch)
{
case 1:
printf("1\n");
default:
printf("2\n");
}
}
Run time error
1 2
1
2
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C code?
#include <stdio.h>
int x;
void main()
{
if (x)
printf("hi");
else
printf("how are u");
}
error
hi
how are you
compile time error
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following C code?
#include <stdio.h>
int main()
{
int a = 1;
if (a--)
printf("True");
if (a++)
printf("False");
}
True
True False
False
No Output
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
#include <stdio.h>
int main()
{
int x = 0;
if (x == 0)
printf("true, ");
else if (x = 10)
printf("false, ");
printf("%d\n", x);
}
compile time error
true, 10
false, 0
true, 0
Create a free account and access millions of resources
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
20 questions
Python Code
Quiz
•
8th Grade - Professio...
20 questions
QUIZ 1 : TOPIC 2 [COSTS : CONCEPT, CLASSIFICATION & COMPONENT]
Quiz
•
University
15 questions
Wednesday CRM Quiz
Quiz
•
University
20 questions
ಸಾಮನ್ಯ ಕನ್ನಡ
Quiz
•
10th Grade - Professi...
20 questions
Aggregate Planning and Resource Planning
Quiz
•
University
20 questions
Microsoft Excel 2013 survey (Intermediate)
Quiz
•
9th Grade - University
15 questions
Design Thinking Session 1
Quiz
•
University - Professi...
20 questions
SMART CITY VOCAB QUIZ
Quiz
•
University
Popular Resources on Wayground
10 questions
Forest Self-Management
Lesson
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
30 questions
Thanksgiving Trivia
Quiz
•
9th - 12th Grade
30 questions
Thanksgiving Trivia
Quiz
•
6th Grade
11 questions
Would You Rather - Thanksgiving
Lesson
•
KG - 12th Grade
48 questions
The Eagle Way
Quiz
•
6th Grade
10 questions
Identifying equations
Quiz
•
KG - University
10 questions
Thanksgiving
Lesson
•
5th - 7th Grade
Discover more resources for Professional Development
10 questions
Identifying equations
Quiz
•
KG - University
7 questions
Different Types of Energy
Interactive video
•
4th Grade - University
20 questions
HS2C2 AB QUIZIZZ
Quiz
•
1st Grade - Professio...
14 questions
Homonyms Quiz
Quiz
•
KG - University
16 questions
Parts of a Parabola
Quiz
•
8th Grade - University
10 questions
A Brief History of Geologic Time
Interactive video
•
11th Grade - University
15 questions
Black Friday/Cyber Monday
Quiz
•
9th Grade - University
7 questions
Biomolecules (Updated)
Interactive video
•
11th Grade - University
