
Decision making in C
Authored by Dr. Singh
Computers
University
Used 6+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the correct syntax for an if statement in C?
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?
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) {
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?
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?
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?
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?
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");
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?
Similar Resources on Wayground
10 questions
GUI Quiz
Quiz
•
University
10 questions
Abhyudaya coding class - Grade 7
Quiz
•
6th Grade - University
15 questions
C++ Switch and If Else Statements
Quiz
•
University
15 questions
Firewall and Network Security
Quiz
•
University
15 questions
GAME QUIZ!!
Quiz
•
University
15 questions
ADVACOMT-Quiz No.1 (final term)
Quiz
•
University
10 questions
Web-II-Loop and Function
Quiz
•
University
10 questions
Condicionales en Racket
Quiz
•
University
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade