Unit 5 : Decision Control in C

Unit 5 : Decision Control in C

University

6 Qs

quiz-placeholder

Similar activities

Basics Of C Programming

Basics Of C Programming

University

10 Qs

c language quiz

c language quiz

University

9 Qs

Control Statements

Control Statements

University

10 Qs

CMP128 Java Ch. 03 Decisions

CMP128 Java Ch. 03 Decisions

University

10 Qs

C - Pointers

C - Pointers

University

10 Qs

B2B: Intro to C

B2B: Intro to C

University

10 Qs

CIS1101-programming practice2

CIS1101-programming practice2

University

10 Qs

Test in C Language

Test in C Language

University

10 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