
C Programming- Control statements
Quiz
•
Professional Development
•
University
•
Hard
Shaik Imam
Used 21+ times
FREE Resource
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
Similar Resources on Wayground
16 questions
New DRAFT
Quiz
•
University
22 questions
CEK PENGETAHUAN LAMEMBA
Quiz
•
University
25 questions
JavaScript cz.1
Quiz
•
4th Grade - Professio...
21 questions
120 - 141
Quiz
•
University
16 questions
PSP Chapter 2
Quiz
•
University
19 questions
Level 2 Review 9 & 10
Quiz
•
6th Grade - Professio...
18 questions
ch 5 Dalil dan Konsep Akuntansi
Quiz
•
KG - Professional Dev...
20 questions
ASJ
Quiz
•
12th Grade - 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 Professional Development
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
