Skip to content

Sshadabsheikh/Assignment-3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Assignment-3

The program calculates the factorial of a number.

A function factorial(n) is defined:
If n < 2, it returns 1 (base case).
Otherwise, it returns n * factorial(n-1) (recursive case).
The user enters a number n.
The program calls factorial(n) to compute the result.
Finally, it prints the factorial of the given number.
Example: If the user enters 5, the program computes 5 × 4 × 3 × 2 × 1 = 120.

The program is about to use of the math module in Python.

It imports all functions from math.
Takes a number as input from the user (A).
Calculates and prints:
The square root of the number (sqrt(A)).
The natural logarithm of the number (log(A)).
The sine value of the number (in radians) (sin(A)).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages