Unit 5 : Decision Control in C

Unit 5 : Decision Control in C

University

6 Qs

quiz-placeholder

Similar activities

Decision Control Structure

Decision Control Structure

University

10 Qs

Unit 3 C Pro P1

Unit 3 C Pro P1

University

8 Qs

Basics of C

Basics of C

University

10 Qs

Skill Development - Debugging Practice1

Skill Development - Debugging Practice1

10th Grade - Professional Development

10 Qs

C Programming Lab Quiz

C Programming Lab Quiz

University

10 Qs

IPC144 SLG -- Week2

IPC144 SLG -- Week2

University

9 Qs

SDF_ˇBX_December24

SDF_ˇBX_December24

University

11 Qs

some questions

some questions

11th Grade - University

8 Qs

Unit 5 : Decision Control in C

Unit 5 : Decision Control in C

Assessment

Quiz

Computers

University

Easy

Created by

Abhishek Pandey

Used 2+ times

FREE Resource

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int x = 2;

if (x > 3)

printf("Hello");

else

printf("World");

Hello

error

World

None

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the else block?

To execute when the if condition is true

To terminate the program

To execute when the if condition is false

None

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

int x = 0;

if (x)

printf("True");

else

printf("False");

True

error

None

False

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many else if blocks can you have in an if-else if ladder?

Only one

Two

Any number

None

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a break statement in switch?

It breaks the program

It terminates the current block and exits the switch

It skips to the next case

None

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if a break statement is missing in a switch case?

The program will not compile

Only the default case executes

An infinite loop is created

Fall-through to the next case occurs