Old Shalimar
Test Session 2021 Class: XII
Test Session 2021 Class: XII Name________________ Test(3): CMP Chap 11 Total time: 1 hr
Test#3 Class: 2nd Year Syllabus: Ch#13 Total Marks: 35
Q#1: Choose the correct answer. (1*7=7)
Academy
1. The parameters in function declaration are called:
a) Actual parameter b) Formal parameter c) Both A and B d) None
2. Multiple arguments to a function are separated by:
a) Comments b) semicolons c) Colons d) Commas
3. A built-in-function:
a) Can’t redefine b) Can be redefine c) Can return a value d) None
4. Function definition can be written:
a) Before main()function b) After main()function
c) In a separate file d) All of these
5. Function declaration consist of:
a) Function Name b) Function return type
c) No and types of parameter d) All of these
6. Global variables are created in:
a) RAM b) ROM c) Hard Disk d) None
7. Local variable are also called:
a) Automatic b) Global c) Normal d) None
Q#2: Answer these short Question.
1) Briefly describe the process of writing a function in C language?
2) Distinguish between formal and actual parameter?
3) Explain Diff between local and global variable by their lifetimes?
4) How does a function return a value? Write syntax!
5) Write a program that’s display first ten numbers using a user-defined function?
6) Define function header? Write syntax!
7) How to call the function by arithmetic expression?
8) What is meant by function prototyping give an example (syntax)?
9) Write a program that takes two numbers from user and passes it to a function which shows
the maximum number.
10) Differentiate between function definition and function declaration?
11) Write a program that checks a number whether is a prime or not using user-defined?
12) Write a program in C language that inputs a number, passes it to a function, the function
will return it after incrementing it by 10, The increment number is displayed by main()?
13) Write a program that takes two number from the user in main and a function will check
which number is maximum simple call the function in main to get the answer?
14) int add(int x, int y); void main()
{
Int a,b,c
A=10, B=23, c;