Previous Questions and answers
Chapter 3 Functions

1.Variables used in the function definition is known as ------(March 2020 Score 1)




2. write the difference between getchar() and putchar() (March 2020 Score 2)




3. Consider the following code:
 int add(int a, int b)
  {
	  int c;
	  c=a+b;
	  return c;
	}
	int main()
	 {
		 int x=10,y=25,z;
		 z=add(x,y);
		 cout<<z;
		 return 0;
	  }	   
a. Write formal and actual arguments in the above code.
b. Write output of the above code.
c. Which type of function call is used in the above code?Explain. (March 2020 score 5	  




4.Name the Mathematical function which returns the absolute value of an integer number.(June 2019 score 1)



5. Explain any two built-in functions in C++ that are used for string manipulation. (June 2019 Score 2)




6. (a) Define Modular Programming. (June 2019 score 3)
(b) Explain the merits of Modular Programming.



7. The process of breaking large program into smaller sub - programs is called ______(March 2019 Score 1)




8. Identify the built in C++ function for the following cases :
(i) to convert -25 to25.
(ii) compare ‘computer’ and ‘COMPUTER’ ignoring cases.
(iii) to check the given character is digit or not.
(iv) to convert the character From ‘B’ to ’b’.
(v) to find the square root of 64 or a number.	(March 2019 Score ) 




9. Write the name of built in function of C++ to convert given character into lower case. (June 2018 score 1)



10. Write the function prototypes for the following function:
(i) A function sum() takes two integer arguments and return integer value.
(ii) A function print() has no arguments and no return value. (June 2018 Score 2)



11. Differentiate actual arguments and formal arguments in C++. (June 2018 Score 2)



12. Consider the following function definition in C++ :
void sum(int a, int b=10, int c=20)
{
int sum=a+b+c;
cout<<sum;
}
Write the output of the following function call :
(a) sum(1,2,3);
(b) sum(2,3);
(c) sum(3);       	(June 2018 Score 3)
     




13. Define built-in function. Give two examples (March 2018 Score 2)



14. Compare call-by-value and call-by-reference methods for calling functions. (March 2018 Score 3)



15. Differentiate between local and global variables. (March 2018 Score 3)



16. Explain three string functions in C++. (June 2017 Score 3)



17. Write a program using a function to interchange the value of two variables. (Use call by reference method to pass the value). (June 2017 Score 3)