1. Write a function findMax that takes three integers as parameters and returns the largest number among them.
  2. Write a function findMin that takes three integers as parameters and returns the smallest number among them.
  3. Write a function isPrime that checks if a positive integer n is a prime number.
  4. Write a function sumDivisors to calculate the sum of all positive divisors of a positive integer n.
  5. Write a function sumDigits to calculate the sum of the digits of an integer n>0n > 0.
  6. Write a function that takes a non-negative integer n as a parameter and finds the smallest and largest digits of n.
  7. Write a function that takes an integer N>1N > 1 and a real number x as parameters and returns the sum: exS=1+x1!+x22!+x33!++xnn!e^x \approx S = 1 + \frac{x}{1!} + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots + \frac{x^n}{n!}
Tài liệu môn học