CodeSolved

Solved Programming Questions & Exercises

Basic math functions library with MathFunctions class

Practice Normal 2199/ Download 18 Views New

Write a program that creates a library with a class called MathFunctions. This class includes the following functions:

  1. Calculate the factorial of a number
  2. Add numbers from a to b
  3. Return the larger number between a and b
  4. Counting the number of digits of a number
  5. Reverse the number and return it
  6. Check whether the number is prime
  7. Calculation of GDM (greatest common divisor) of two numbers
  8. Calculate LCM (least common multiple) of two numbers
  9. Counting the number of divisors of a number
  10. return the absolute value of the number (for example -5 becomes 5)
  11. Checking whether the number is even or odd

1 Answers

This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
Ai Python New

Submit answer

Submitting answers is currently unavailable.

×
×
Close