C PROGRAMMING
MULTIPLE CHOICE QUESTION
OLD QUESTION BANK
SAMPLE QUESTION 2080 AND SOLUTION

         ASSIGNMENT -6

         FUNCTION 

  1. Define function . Explain its importance. and also discuss various parts of function.
  2. WAP to compute a combination of numbers ncr without using a function.’
  3. WAP to compute combination of numbers ncr . Use a function to calculate the factorial of a  number.
  4. Define a function int greater(int,int) to find the greatest number among two numbers. WAP uses this function to find the greatest number among three numbers.
  5. WAP which has two user-defined functions named process() and display(). Read two numbers from the user in the main() function and pass them to the function process() as an argument to add the numbers and return sum. Finally use another function display() to display the result.
  6. WAP TO SWAP THE VALUE OF TWO VARIABLES USING CALL BY VALUE.
  7. WAP TO SWAP THE VALUE OF TWO VARIABLES USING CALL BY REFERENCE.
  8. What is a recursive function ? Why do we need recursive function?
  9. WAP TO FIND FACTORIAL OF A NUMBER USING RECURSIVE FUNCTION.
  10. WAP TO GENERATE THE FOLLOWING FIBONACCI SERIES USING rRECURSIVE METHOD. 
  11. DEFINE A FUNCTION WHICH RECEIVE TEMPERATURE IN CENTIGRADE AND RETURN EQUIVALENT FAHRENHEIT. USE THIS FUNCTION IN MAIN PROGRAM FOR TEMPERATURE CONVERSION.
  12. Write a function to evaluate y=x^n where y and x are floating point numbers to be raised to an integer power.
  13. DEFINE A FUNCTION WHICH RECEIVES A NUMBER AS ARGUMENT AND RETURNS 1 IF THE NUMBER IS PRIME OTHERWISE RETURN O. USE THIS FUNCTION IN MAIN TO CHECK A NUMBER FOR PRIME OR NOT.
  14. WAP TO READ A NUMBER N FROM USER AND CALCULATE SUM 0F FIRST N NATURAL NUMBER USING RECURSIVE FUNCTION.
  15. WAP to read an integer from keyword and returns the sum of even valued digits using the function
  16. Use recursive function to write a C program to calculate the sum of the digits of a given number which is a single digit number.if the sum contains two or more than two digits then go on adding the digits of the number unless you get a single digit number.[2345=2+3+4+5=14=1+4=5]
  17. WAP TO DISPLAY THE REVERSE OF A NUMBER USING RECURSION.
  18. Write a function to evaluate y=x^n where y and x are floating point numbers to be raised to an integer power using recursion.
  19. Explain different types of variables. Write an example code for Static, Local and Global variables.