Search Header Logo

Functions in C - Worksheet

Authored by V. Charles Prabu

Information Technology (IT)

11th Grade

Used 1+ times

Functions in C - Worksheet
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

What is a function in C?

A variable that stores data

A block of code that performs a specific task

A loop that repeats code

A comment in the program

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to define a function in C?

define

function

void

No special keyword is needed

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the return statement in a function?

To print output

To exit the program

To send a value back to the caller

To define a variable

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a correct function declaration in C?

function add(int a, int b)

int add(int a, int b)

add(int a, int b)

int add(a, b)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default return type of a function in C if not specified?

void

float

int

char

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is used to pass arguments to a function in C?

return

main()

Function parameters

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the void keyword indicate in a function declaration?

The function returns a value

The function has no name

The function does not return any value

The function has no parameters

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?