Control Statements

Control Statements

University

10 Qs

quiz-placeholder

Similar activities

C-Volution (Hard)

C-Volution (Hard)

University

10 Qs

placement g2 quiz-1

placement g2 quiz-1

University

15 Qs

Mastering Python Control Flow

Mastering Python Control Flow

University

15 Qs

Basic Logic & Programming pt.2

Basic Logic & Programming pt.2

6th Grade - University

10 Qs

Java_Quiz_Part_2

Java_Quiz_Part_2

University

12 Qs

C Programming Quiz

C Programming Quiz

University

10 Qs

Lab Quizz

Lab Quizz

University

11 Qs

Code Twisters Round 1 Demo

Code Twisters Round 1 Demo

University

10 Qs

Control Statements

Control Statements

Assessment

Quiz

Information Technology (IT)

University

Hard

Created by

Shivanthana 2909

Used 4+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A smartwatch needs to alert the user when the battery drops below 20%. Which control statement should be used?

Switch-case

for loop

if-else

do-while

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A game controller must perform different actions when different buttons are pressed (A = Jump, B = Crouch, etc.). What is the best control structure?

if-else

nested loops

switch-case

break

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int x = 5;

if (x > 3)

printf("Hello");

else

printf("Bye");

Hello

Bye

error

No output

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You’re building an automation system for a smart air conditioner. Based on temperature input, it decides to turn the fan ON or OFF. What would you use?

switch-cse

if-else

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax for an if-else statement in C?

if condition then { } else { }

if (condition) { } else { }

if {condition} then { } else { }

if condition: { } else: { }

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT true about the switch-case statement in C?

It can evaluate expressions like x > 10

It uses case labels for matching values

It can replace lengthy nested if-else structures

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

You are designing a coffee machine. It should display different prices based on size (S, M, L). Which control is most appropriate?

if-else with relational operators

for loop with size check

switch-case with character input

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?