Professional Documents
Culture Documents
Header Files: The required header file “stdio.h” is included, which provides input/output
functions like „printf‟ and „scanf‟.
lcm function: It calculates the Least Common Multiple (LCM) of two numbers using the
formula “(a * b) / gcd(a, b)”.
Main Function:
Num1 and Num2: These variables of type double are used to store the two numbers entered by
the user.
Name array: This character array with a size of 50 is used to store the name of the user.
User Input: The program asks the user to enter his/her name, and it reads the name using scanf.
Then it asks the user to enter the two numbers and reads them using scanf.
Arithmetic Operations:
The program performs several arithmetic operations on the entered numbers, such as addition,
subtraction, multiplication, and division. The results are stored in sum, sub, mult, and Div
variables, respectively.
The program prints the results of these arithmetic operations using „printf‟.
Summary:
The code is a basic math calculator that allows the user to enter their name and two numbers. It
performs arithmetic operations on the numbers, calculates the GCD and LCM, and displays the
results. It provides a simple and interactive way for users to perform calculations.