Unit 5 : Decision Control in C

Unit 5 : Decision Control in C

University

6 Qs

quiz-placeholder

Similar activities

Java Control Flow statements

Java Control Flow statements

University

10 Qs

Quiz on Basics of C

Quiz on Basics of C

University

10 Qs

Tech Quiz

Tech Quiz

University

10 Qs

Test in C Language

Test in C Language

University

10 Qs

CMP128 Java Ch. 02 Sequence & Fundamentals

CMP128 Java Ch. 02 Sequence & Fundamentals

University

10 Qs

Programming 1

Programming 1

University

10 Qs

Pemrograman Dasar Kelas X TKJ Smt 2

Pemrograman Dasar Kelas X TKJ Smt 2

12th Grade - University

10 Qs

Unit 13 Function and decision

Unit 13 Function and decision

University

6 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