Search Header Logo

QP-DCM

Authored by Rajesh Yelchuri

others

24 Questions

QP-DCM
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid if-else statement?

if (x > 0) {} else {}
if (x > 0) {} elseif {}
if else (x > 0) {}
if (x > 0) else {}

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many branches can an if-else statement have?

1
2
3
Unlimited

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is used for multiple conditions in C?

if
if-else
if-else-if ladder
switch

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In an if-else-if ladder, how many else-if statements can you have?

Only 1
Only 2
No limit
Exactly 3

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? int x = 10; if (x == 10) printf("Ten"); else printf("Not Ten");

Ten
Not Ten
Error
Nothing

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default case in a switch statement?

It executes if none of the cases match
It executes if all cases match
It is mandatory
It is executed first

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Can we have a nested if inside an else statement?

Yes
No
Only with loops
Only inside switch

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?