Class XII Assignment 1 ( C Function )

FUNCTION (Assignment) Submit Before Mid Term
MCQ

1. What is the output of this statement “printf(“%d”,a++) in C programming?
a. The current value of a
b. The value of a increment by 1
c. Error
d. Garbage

2. Which of the following is a correct format for declaration function?
a. return-type function-name(argument type);
b. return-type function-name(argument type){}
c. return-type (argument type)function name;
d. all of the above

3. Which of the following declaration is illegal?
a. int 1bhk(int);
b. int 1bkt(int a);
c. int 1 bkt(int *, int[])
c. all of the above

 

Short Answer Question

  1. What is a function? List out the advantages of functions.
  2. What do you mean by library function? Differentiate between library function and user defined function.
  3. What are the different components of functions? Explain.
  4. What are different types of functions explain with example.
  5. What is recursive function explain with example
  6. What do you mean an by storage class? Explain different storage classes with example.

Programs:

  1. Write a program to calculate the factorial of given number using function.
  2. Write a program to calculate the factorial of given number using recursive function.
  3. Write a program to display sum of n even number using function.
  4. Write a program to display the Fibonacci series up to 10th term by using recursive function.
  5. Write a program to enter a radius of a circle and display its area using user defined function.
  6. Write a program to check whether the entered number is prime number or not using function.
  7. Write a program using a user defined function to calculate y raise to power x.
  8. Write a program to enter 2X2 matrices, pass them in a function and display the matrix.
  9. Write a program to print transpose of matrix (2×2 type) using array and function.
  10. Write a program to enter two 3×3 matrices, pass them in a function and find their sum.

Leave a Comment