Search Header Logo

C Programing Quiz

Authored by Muntazim Alam

Computers

University

Used 1+ times

C Programing Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which loop guarantees that the loop body will be executed at least once?

  • A) for

  • B) while

  • C) do-while

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code?

int arr[5] = {1, 2, 3, 4, 5}; printf("%d", arr[3]);

  • A) 3

  • B) 4

  • C) 5

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following correctly defines a function with no return value and no parameters?

  • A) void func() {}

  • B) func(void) {}

  • C) int func() {}

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following code snippet print?

int i; for (i = 0; i < 5; i++) { printf("%d ", i); }

  • A) 0 1 2 3 4

  • B) 1 2 3 4 5

  • C) 0 1 2 3 4 5

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to access the last element of an array arr with 10 elements?

  • A) arr[9]

  • B) arr[10]

  • C) arr[8]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code?

int i = 10; while (i > 5) { i--; } printf("%d", i);

  • A) 6

  • B) 5

  • C) 10

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is true about functions in C?

  • A) Functions cannot return arrays.

  • B) Functions can only have one parameter.

  • C) Functions cannot call other functions.

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?