C Program Day 2

C Program Day 2

University

17 Qs

quiz-placeholder

Similar activities

Together We Grow - 2

Together We Grow - 2

University

15 Qs

C Quiz

C Quiz

University

15 Qs

Tech quiz Round 1

Tech quiz Round 1

University

15 Qs

Quiz

Quiz

University

15 Qs

2R C-Skill Lab Test Autumn 2024-25

2R C-Skill Lab Test Autumn 2024-25

University

14 Qs

python script

python script

University

16 Qs

Blind coding

Blind coding

University

15 Qs

Day -1

Day -1

University

15 Qs

C Program Day 2

C Program Day 2

Assessment

Quiz

Other

University

Medium

Created by

ALAN SANTO

Used 1+ times

FREE Resource

17 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What is the purpose of the else if statement in C?

To define a default case in a switch statement.
To create an infinite loop condition.
To provide additional conditional branches in a control flow.
To terminate a loop prematurely.

2.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Choose the correct syntax to while loop in C

while { condition; // code }
while(condition) // code;
while: condition { code }
while(condition) { // code }

3.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What does "i++" in C Means?

The expression 'i++' increments the value of 'i' by 1.

The expression 'i++' multiplies the value of 'i' by 2.
The expression 'i++' decrements the value of 'i' by 1.

The expression 'i++' assigns the value of 'i' to 0.

4.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What is the main use of a for loop in C?

To handle exceptions in C.
To define a function in C.

To loop through a block of code a specific number of times

To create a single-use variable.

5.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

"for (i = 0; i < 5; i++)"

What is the role of i here?

The role of 'i' is to store the final result.
The role of 'i' is to represent an array element.

The role of 'i' is to act as a loop counter.

The role of 'i' is to define a function parameter.

6.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What is a nested loop in C?

A nested loop in C is a loop that cannot contain any other loops.
A nested loop in C is a loop that exists within another loop.
A nested loop in C is a loop that runs only once.
A nested loop in C is a loop that executes in parallel with another loop.

7.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

What is the output of the following code snippet: for(int i = 0; i < 3; i++) { printf("%d ", i); }

3 2 1

0 1 2

1 2 3

0 1 2 3

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?