0% found this document useful (0 votes)
4 views

Chapter 1 Function 1mrk

This document contains a set of one-mark questions for Grade XII A1 students studying Computer Science, specifically focusing on the topic of functions. The questions cover various aspects of functions, including definitions, characteristics, advantages, and differences between related concepts. It serves as an assessment tool for students affiliated with the Royal Vidyalaya CBSE in Madurai.

Uploaded by

amruthamscct
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Chapter 1 Function 1mrk

This document contains a set of one-mark questions for Grade XII A1 students studying Computer Science, specifically focusing on the topic of functions. The questions cover various aspects of functions, including definitions, characteristics, advantages, and differences between related concepts. It serves as an assessment tool for students affiliated with the Royal Vidyalaya CBSE in Madurai.

Uploaded by

amruthamscct
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Royal Group of Schools

Royal Vidyalaya CBSE


Affiliated to cbse, New delhi
Affiliation No:1931540
Mayandithevar Nagar, CITU colony,
Vilangudi, Madurai-18

GRADE: XII A1 ONE MARK QUESTIONS MARKS: 50

CHAPTER 1 FUNCTIONS COMPUTER SCIENCE

1. The small sections of code that are used to perform a particular task is called ……………………….
(a) Subroutines (b) Files (c) Pseudo code (d) Modules

2. Which of the following is a unit of code that is often defined within a greater code structure?
(a) Subroutines (b) Function (c) Files (d) Modules

3. Which of the following is a distinct syntactic block?


(a) Subroutines (b) Function (c) Definition (d) Modules

4. The variables in a function definition are called as ……………………….


(a) Subroutines (b) Function (c) Definition (d) Parameters

5. The values which are passed to a function definition are called ……………………….
(a) Arguments (b) Subroutines (c) Function (d) Definition

6. Which of the following are mandatory to write the type annotations in the function definition?
(a) Curly braces (b) Parentheses (c) Square brackets (d) Indentations

7. Which of the following defines what an object can do?


(a) Operating System (b) Compiler (c) Interface (d) Interpreter

8. Which of the following carries out the instructions defined in the interface?
(a) Operating System (b) Compiler (c) Implementation (d) Interpreter

9. The functions which will give exact result when same arguments are passed are called
……………………….
(a) Impure functions (b) Partial Functions

(c) Dynamic Functions (d) Pure functions

10. The functions which cause side effects to the arguments passed are called ……………………….
(a) Impure functions (b) Partial Functions

(c) Dynamic Functions (d) Pure functions

11.What is the main purpose of a function in programming?

a) To repeat a set of statements b) To perform a specific task

c) To declare variables d) To control program flow

12.Which of the following is a characteristic of a function?

a) It can be called only once b) It can have only one return statement

c) It has a unique name d) It can have only one parameter


13.What is the difference between an argument and a parameter?

a) Argument is the value passed to a function, while parameter is the variable that receives the
argument

b) Argument is the variable that receives the value, while parameter is the value passed to a
function

c) Argument is the same as a parameter

d) Argument and parameter are unrelated

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

a) To exit the function b) To return a value to the calling program

c) To pass arguments to the function d) To declare variables

15. Which of the following is an advantage of using functions in programming?

a) It makes the program longer b) It makes the program more complex

c) It makes the program easier to read and maintain d) It makes the program slower

16.What is the purpose of function declaration?

a) To define the function b) To call the function

c) To declare the function name and parameters d) To return a value from the
function

17. Which of the following is a type of function?

a) Library function b) User-defined function

c) Operating system function d) All of the above

18. Which of the following is a benefit of using functions?

a) It makes the program longer b) It makes the program more complex

c) It makes the program reusable and modular d) It makes the program slower

19.What is the purpose of the function header?

a) To declare the function name and parameters b) To define the function body

c) To call the function d) To return a value from the function

20. What is the difference between a function definition and a function call?

a) A function definition declares the function, while a function call executes the function

b) A function definition executes the function, while a function call declares the function

c) A function definition is used to declare variables, while a function call is used to pass arguments

d) A function definition is used to pass arguments, while a function call is used to declare variables

21.What is the purpose of the return type in a function declaration?

a) To specify the type of value returned by the function

b) To specify the number of parameters passed to the function

c) To specify the name of the function


d) To specify the scope of the function

22.Which of the following is a characteristic of a void function?

a) It returns a value b) It takes no arguments

c) It does not return a value d) It is used to declare variables

23.What is the purpose of function arguments?

a) To pass values to the function b) To return values from the function

c) To declare variables d) To specify the function name

24. Which of the following is an example of a function with a single return statement?

a) int add(int x, int y) { return x + y; }

b) void print(int x) { printf("%d", x); }

c) int max(int x, int y) { if (x > y) return x; else return y; }

d) int sum(int x, int y) { return x + y; return x - y; }

25. 1. What is the difference between a function with a return type of int and a function with a
return type of void?

a) A function with a return type of int returns a value, while a function with a return type of void
does not return a value

b) A function with a return type of int takes no arguments, while a function with a return type of
void takes arguments

c) A function with a return type of int is used to declare variables, while a function with a return
type of void is used to pass arguments

d) A function with a return type of int is used to pass arguments, while a function with a return
type of void is used to declare variables

26. What is the purpose of the return type in a function declaration?

a) To specify the type of value returned by the function

b) To specify the number of parameters passed to the function

c) To specify the name of the function

d) To specify the scope of the function

27. 1. Which of the following is a characteristic of a void function?

a) It returns a value b) It takes no arguments

c) It returns no value d) It is used only for recursion

28.Which of the following is an example of a function with a return type of int?

a) void display(); b) int sum(int, int);

c) void main(); d) double area(double);

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

a) To exit the function and return control to the calling program

b) To pass arguments to the function


c) To declare variables

d) To specify the return type of the function

30. Which of the following is a benefit of using functions in programming?

a) It makes the program longer b) It makes the program more complex

c) It makes the program reusable and modular d) It makes the program slower

31.What is the purpose of function parameters?

a) To return values from the function b) To pass values to the function

c) To declare variables d) To specify the return type of the function

32.Which of the following is an example of a function with two parameters?

a) int add(int x, int y); b) void display(); c) int sum(int x); d) double area();

33. What is the difference between a function definition and a function declaration?

a) A function definition declares the function, while a function declaration defines the function

b) A function definition defines the function, while a function declaration declares the function

c) A function definition is used to call the function, while a function declaration is used to define
the function

d) A function definition is used to declare variables, while a function declaration is used to pass
arguments

34. Which of the following is a benefit of using recursion in programming?

a) It makes the program slower b) It makes the program more complex

c) It makes the program more efficient d) It makes the program easier to understand

35.What is the base case in a recursive function?

a) The first call to the function b) The last call to the function

c) The case that stops the recursion d) The case that starts the recursion

36.Which of the following is an example of a recursive function?

a) int sum(int x, int y) { return x + y; }

b) void display(int x) { printf("%d", x); }

c) int factorial(int x) { if (x == 0) return 1; else return x * factorial(x-1); }

d) double area(double x) { return 3.14 * x * x; }

37.What is the purpose of the return statement in a recursive function?

a) To exit the function and return control to the calling program

b) To pass arguments to the function

c) To declare variables

d) To stop the recursion

38.What is the difference between a recursive function and an iterative function?


a) A recursive function uses a loop, while an iterative function uses a recursive call

b) A recursive function uses a recursive call, while an iterative function uses a loop

c) A recursive function is faster, while an iterative function is slower

d) A recursive function is more efficient, while an iterative function is less efficient

39. Which of the following is a disadvantage of using recursion in programming?

a) It makes the program faster b) It makes the program more efficient

c) It uses more memory and can cause stack overflow d) It is easier to understand and
implement

40.What is the purpose of the recursive call in a recursive function?

a) To stop the recursion

b) To start the recursion

c) To repeat the function call until the base case is reached

d) To exit the function and return control to the calling program

41.Which of the following is an example of a problem that can be solved using recursion?

a) Finding the maximum element in an array b) Calculating the factorial of a number

c) Finding the sum of an array d) Finding the minimum element in an array

42. What is the base case in a recursive function?

a) The first call to the function b) The last call to the function

c) The case that stops the recursion d) The case that starts the recursion

43.What is the purpose of the termination condition in a recursive function?

a) To start the recursion

b) To stop the recursion

c) To repeat the function call until the base case is reached

d) To exit the function and return control to the calling program

44.Which of the following is a characteristic of a recursive algorithm?

a) It uses a loop to repeat the function call b) It uses a recursive call to repeat the function
call

c) It uses a stack to store the function calls d) It uses a queue to store the function calls

45.What is the difference between a recursive function and a loop?

a) A recursive function uses a loop, while a loop uses a recursive call

b) A recursive function uses a recursive call, while a loop uses a iterative call

c) A recursive function is faster, while a loop is slower

d) A recursive function is more efficient, while a loop is less efficient

46. Which of the following is an advantage of using recursion in programming?


a) It makes the program slower

b) It makes the program more complex

c) It makes the program more efficient and easier to understand

d) It uses more memory and can cause stack overflow

47. What is the purpose of the recursive function call in a recursive algorithm?

a) To stop the recursion

b) To start the recursion

c) To repeat the function call until the base case is reached

d) To exit the function and return control to the calling program

48. What is the main advantage of using dynamic programming over recursive functions?

a) It uses less memory

b) It is faster

c) It avoids stack overflow

d) It is easier to implement

49. Which of the following is a characteristic of dynamic programming algorithms?

a) They use a recursive approach b) They use a iterative approach

c) They use a divide and conquer approach d) They use a greedy approach

50. Which of the following is an example of a problem that can be solved using dynamic
programming?

a) Shortest path problem b) Minimum spanning tree

c) Maximum subarray problem d) All of the above

You might also like