practice_C

Advanced Functions

Exercises

  1. Calculate simple interest using a function.
  2. Define a function that adds two numbers.
  3. Demonstrate the difference between a global variable and a static local variable.
  4. Write a function that converts a string argument from lowercase to uppercase.
  5. Calculate nCr = n! / (r! * (n-r)!) using user-defined functions.
  6. Write a function that accepts two numbers and returns their GCD.

Click here for explanation and solution.