Search Header Logo

C Programming Quiz

Authored by AKHILA P

Computers

Professional Development

Used 1+ 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

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the correct way to declare an integer variable in C?

int 1number;

int number1;

number int;

int ; number1

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is the correct syntax for a for loop in C?

for (i = 0; i < 10; i++)

for (i < 10; i++)

for i = 0; i < 10; i++

for (i = 0; i < 10)

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How do you access the third element of an array named arr in C?

arr[2]

arr[3]

arr(3)

arr{3}

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is a valid if statement in C?

if x > 10

st1;

if (x > 10)

{

st1;

}

if (x > 10);

st1;

if x > 10

{

st1;

}

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which library is required to use the strlen function?

stdlib

stdio

string

ctype

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following code? for (int i = 0; i < 5; i++) { printf("%d ", i); }

0 1 2 3 4

1 2 3 4 5

0 1 2 3 4 5

error

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is the correct syntax for a while loop in C?

while (condition) { statement; }

while condition { statement; }

while (condition) statement;

while { condition; }

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?