
Decision making in C

Quiz
•
Computers
•
University
•
Medium
Dr. Singh
Used 5+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the correct syntax for an if statement in C?
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following statements is true about the else if construct?
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will the following code print if x = 10?
if (x < 5) {
printf("Less than 5");
} else if (x < 15) {
printf("Less than 15");
} else {
printf("15 or more");
}
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
In C, which of the following statements correctly implements a switch-case?
switch(expression) { case value1: // code block; default: // code block; }
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the following code output if num is 3?
switch (num) {
case 1:
printf("One");
break;
case 2:
printf("Two");
break;
default:
printf("Default");
break;
}
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following expressions is evaluated in an if statement in C?
Integer values only
Boolean values only
Any expression that evaluates to zero (false) or non-zero (true)
String literals only
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code segment?
int a = 5, b = 10;
if (a > b)
printf("A is greater");
else if (a < b)
printf("B is greater");
else
printf("A and B are equal");
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
ARRAYS AND FUNCTIONS

Quiz
•
University
10 questions
Basics of C

Quiz
•
University
15 questions
Software Testing Basics

Quiz
•
University
10 questions
Structure in C

Quiz
•
University
10 questions
Weekly Contest #6 - TechXNinjas

Quiz
•
University
8 questions
Unit 3 C Pro P1

Quiz
•
University
15 questions
Quiz -3: JavaScript & PHP (AIML)/CC/1st Year

Quiz
•
University
9 questions
IPC144 SLG -- Week2

Quiz
•
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 Computers
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