C Programming Quiz

C Programming Quiz

University

36 Qs

quiz-placeholder

Similar activities

InfoMeraki2020

InfoMeraki2020

University

39 Qs

Midterm 2 Review

Midterm 2 Review

University

31 Qs

JAVA STRINGS

JAVA STRINGS

University

31 Qs

CIE As A level Chpt_20: Object-Oriented Programming

CIE As A level Chpt_20: Object-Oriented Programming

11th Grade - University

35 Qs

python

python

11th Grade - University

35 Qs

Python.Comp Quiz (Python Coding)

Python.Comp Quiz (Python Coding)

9th Grade - University

40 Qs

function in Python

function in Python

University

37 Qs

IT 121- Formative Assessment # 2

IT 121- Formative Assessment # 2

University

40 Qs

C Programming Quiz

C Programming Quiz

Assessment

Quiz

Computers

University

Hard

Created by

Dr. Gera

Used 1+ times

FREE Resource

36 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

void

int

float

char

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to explicitly return a value from a function?

return

break

exit

stop

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the scope of a variable declared inside a function in C?

Global

Block

Local

Static

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for defining a function in C?

return_type function_name(parameters) { function_body }

function_name(parameters) return_type { function_body }

function_name { function_body } return_type

return_type { function_body } function_name(parameters)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if a function is called but not defined in C?

Compilation error

Runtime error

Undefined behavior

No error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid function prototype in C?

int sum(int, int);

sum(int, int);

int sum;

sum(int a, int b)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about global variables is true?

They can only be accessed in the function where they are declared

They retain their value throughout the program execution

They must be declared inside a function

They cannot be modified once initialized

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?