Faculty of Computing Information Systems and Mathematics - FCIM
Department of Computer Science Programming in C CSU07202 – BIT 1 & BCS 1 Tutorial VII
1. What is the difference between an actual argument and a formal parameter?
2. Explain at least four advantages of functions. 3. Create a function called min(x, y) that returns the smaller of two double values. 4. Write a function that takes three arguments: a character and two integers. The character is to be printed. The first integer specifies the number of times that the character is to be printed on a line, and the second integer specifies the number of lines that are to be printed. Write a program that makes use of this function. 5. The harmonic mean of two numbers is obtained by taking the inverses of the two numbers, averaging them, and taking the inverse of the result. Write a function that takes two double arguments and returns the harmonic mean of the two numbers. 6. Create a function called alter() that takes two int variables, x and y , and changes their values to their sum and their difference, respectively. 7. Write a function that returns the largest of three integer arguments.