Basic C Programming - Function parameter

Basic C Programming - Function parameter

12th Grade

10 Qs

quiz-placeholder

Similar activities

Python quiz

Python quiz

KG - Professional Development

10 Qs

PBO

PBO

12th Grade

15 Qs

ETECH_ABMA_M2QUIZ

ETECH_ABMA_M2QUIZ

12th Grade

10 Qs

TET HOLIDAY

TET HOLIDAY

KG - 12th Grade

15 Qs

Website Development

Website Development

6th - 12th Grade

14 Qs

Functions (C++ and ESP32)

Functions (C++ and ESP32)

12th Grade - University

15 Qs

JavaScript

JavaScript

1st - 12th Grade

10 Qs

Python Functions Quiz

Python Functions Quiz

12th Grade

10 Qs

Basic C Programming - Function parameter

Basic C Programming - Function parameter

Assessment

Quiz

Education

12th Grade

Hard

Created by

Hafizul Hasmie

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the syntax for declaring a function in C?

parameters function_name(return_type)

return_type function_name(parameters)

return_type function_name(parameters);

function_name(parameters) return_type

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you define a function in C?

function_name(Parameters) { // Function body }

Return_Type Parameters function_name { // Function body }

function_name(Parameters) { // Function body } Return_Type

Return_Type function_name(Parameters) { // Function body }

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a function prototype in C?

A function prototype in C is a declaration of a function that specifies only the function's name.

A function prototype in C is a definition of a function that includes the function body.

A function prototype in C is a declaration of a function that specifies the function's name and return type but not the parameters.

A function prototype in C is a declaration of a function that specifies the function's name, return type, and parameters without providing the function body.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Explain pass by value in C with an example.

In C, pass by value is demonstrated by passing variables to a function and modifying them inside the function. The original variables remain unchanged after the function call.

Pass by value in C involves passing pointers to variables

Pass by value in C allows direct modification of original variables inside a function

Pass by value in C means passing variables to a function without modifying them

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

To print a message on the console

To terminate the function and return a value

To skip the function and move to the next one

To pause the execution of the program

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a function that takes two integer parameters in C?

void functionName(int param1, int param2)

int functionName(int param1, int param2)

void functionName(int param1; int param2)

void functionName(param1, param2)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between function declaration and function definition in C?

Function declaration specifies the function signature, while function definition includes the implementation.

Function declaration includes the implementation, while function definition specifies the signature.

Function declaration and function definition are interchangeable terms in C.

Function declaration defines the function signature, while function definition specifies the implementation.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?