Search Header Logo

Quiz 2 - loops, array, pointers, functions

Authored by Nagaratna Harikant

Computers

Professional Development

Used 5+ times

Quiz 2 - loops, array, pointers, functions
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which is the correct way to declare a function in C?

function_name(return_type parameter_list);

return_type function_name(parameter_list);

function_name return_type(parameter_list);

return_type (parameter_list) function_name;

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of these defines a function without arguments in C?

void func()

void func(void)

void func(arguments)

void func(int x)

3.

FILL IN THE BLANK QUESTION

45 sec • 1 pt

  • Fill in the blank: What is the default return type of a function in C if not specified?

4.

MULTIPLE CHOICE QUESTION

30 sec • Ungraded

  • Which of the following loops guarantees execution at least once?

for loop

do while loop

while loop

None

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a for loop, which part is executed only once at the beginning?

Condition

Initialization

Increment/Decrement

Loop body

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used to get the address of a variable in C?

*

&

->

.

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

void main() { int i = 3, *j; j = &i; printf("%d\n", i * *j * i + *j); }

27

3

9

30

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?