Search Header Logo

c programming quiz

Authored by Sindhuja. M

Engineering

University

Used 1+ times

c programming quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

SET A = 5

SET B = 10

IF A > B THEN

PRINT "A"

ELSE

PRINT "B"

END IF

A

B

5

10

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

SET X = 3

WHILE X < 6 DO

PRINT X

SET X = X + 1

END WHILE

3 4 5

3 4 5 6

3 4 5 6 7

Infinite Loop

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

SET SUM = 0

FOR I = 1 TO 4 DO

SUM = SUM + I

END FOR

PRINT SUM

10

6

15

5

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

INPUT N

SET FACT = 1

FOR I = 1 TO N DO

FACT = FACT * I

END FOR

PRINT FACT

Prints sum of N natural numbers

Prints square of N

Prints factorial of N

Prints N

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

SET A = 2

SET B = 3

SET C = A

SET A = B

SET B = C

PRINT A, B

2, 3

3, 2

3, 3

2, 2

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

SET A = 7

IF A MOD 2 = 0 THEN

PRINT "Even"

ELSE

PRINT "Odd"

END IF

Even

Odd

7

0

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

INPUT N

SET SUM = 0

WHILE N > 0 DO

SUM = SUM + (N MOD 10)

N = N DIV 10

END WHILE

PRINT SUM

Count digits of N

Count digits of N

Reverse N

Multiply digits of N

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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?