NM with C

NM with C

University

10 Qs

quiz-placeholder

Similar activities

Alternating Current

Alternating Current

University

10 Qs

Ohm's Law and Circuits Quiz

Ohm's Law and Circuits Quiz

University

10 Qs

dallas cowboys

dallas cowboys

KG - Professional Development

14 Qs

Cinemática

Cinemática

University

15 Qs

Electricity (Review)

Electricity (Review)

12th Grade - University

10 Qs

Capacitance Reactance

Capacitance Reactance

11th Grade - University

13 Qs

Projectile Motion

Projectile Motion

6th Grade - University

15 Qs

Universal Gravitation

Universal Gravitation

University

14 Qs

NM with C

NM with C

Assessment

Quiz

Physics

University

Hard

Created by

Yamini Dhanabalan

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

In C, how many times will the following code block execute? int i = 0; do { i++; } while(i < 3);
3
2
0
1

2.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

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

3.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which statement is used to terminate a loop in C before its normal completion?
break
exit
return
continue

4.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

In C, what is the initial value of the loop control variable 'i' in the following loop? for(int i = 10; i < 15; i++) { ... }
10
15
0
1

5.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What will be the output of the following code snippet? int i; for(i = 0; i < 3; i++) { if(i == 1) continue; printf("%d ", i); }
0 2
1 2
0 1
0 1 2

6.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

What is the output of the following code snippet if x is set to 10? `if (x < 5) { printf("Low"); } else if (x < 15) { printf("Medium"); } else { printf("High"); }`
Medium
High
Error
Low

7.

MULTIPLE CHOICE QUESTION

30 sec • 2 pts

Which of the following is a valid syntax for a switch statement in C?
switch(expression) { case value: // code }
switch [expression] { case value: // code }
if (expression) { code }
foreach(expression) { // code }

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?