Conditional and unconditional Statements

Conditional and unconditional Statements

University

15 Qs

quiz-placeholder

Similar activities

CSE C Section

CSE C Section

University

20 Qs

Quiz on Basics of C

Quiz on Basics of C

University

10 Qs

Programming 1

Programming 1

University

10 Qs

Printf, scanf

Printf, scanf

University

12 Qs

ECE-C Quiz _3

ECE-C Quiz _3

University

10 Qs

Programming C

Programming C

University

20 Qs

Programing Unit-2

Programing Unit-2

University

20 Qs

Day 1 Quiz

Day 1 Quiz

11th Grade - University

12 Qs

Conditional and unconditional Statements

Conditional and unconditional Statements

Assessment

Quiz

Computers

University

Hard

Created by

Athulya SRK

Used 2+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

for (int i = 0; i < 3; i++) {

printf("%d ", i);

}

return 0;

}

1 2 3

0 1 2

0 0 0

Error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

int count = 2;

while (count > 0) {

printf("Hello ");

count--;

}

return 0;

}

Hello Hello

Hello

Hello Hello Hello

"Hello"

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

int x = 3;

while (x > 0) {

printf("%d ", x);

x--;

}

return 0;

}

3 2 1 0

4 2 0

3 2 1

3 3 3

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

int y = 0;

do {

printf("%d ", y);

y++;

} while (y < 3);

return 0;

}

2 1 0

1 2 3

0 1 2

1 2

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

int count = 1;

while (1) {

printf("%d ", count);

count++;

if (count > 5) {

break;

}

}

return 0;

}

1 2 3 4

5

0

1 2 3 4 5

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

for (int i = 1; i <= 5; i++) {

if (i % 2 == 0) {

continue;

}

printf("%d ", i);

}

return 0;

}

1 3 5

1 2 3 4 5

0 1 2 3 4

0 2 4

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

#include <stdio.h>

int main() {

int z = 5;

for (int i = 0; i < z; i++) {

if (i % 2 != 0) {

printf("%d ", i);

}

}

return 0;

}

1 3

0 2 4

1 2 3 4

2 4

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?