Search Header Logo

C Programming Quiz

Authored by Kommu Kusumakumari

Computers

University

Used 3+ times

C Programming Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the purpose of the #include directive in a C program?

To include the standard input/output library

To define a constant

To declare variables

To initialize the main function

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is the correct way to declare a variable in C?

int x;

int x = 10;

int x + 10;

declare int x = 10;

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the purpose of the break statement in a loop?

To terminate the loop immediately

To skip the current iteration

To restart the loop

To execute the next statement after the loop

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which loop construct in C is best suited for a situation where the number of iterations is known beforehand?

while loop

do-while loop

for loop

infinite loop

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is a valid way to declare a 2D array in C?

int arr[3][4];

int arr[3,4];

int[3][4] arr;

int arr(3)(4);

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is NOT a logical operator in C?

AND

OR

NOT

IF

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which comparison operator can be used to check if one value is less than another?

!==

>=

==

<

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?

Discover more resources for Computers