In this video, we will write a C program to multiply two numbers. In math, multiplication is the method of finding the product of two or more numbers.
Example:
Input numbers: 2, 3
Output = 6
Approach:
Step 1: Enter two integer numbers and the input is scanned using the scanf() function and stored in the variables A and B.
Step 2: The variables A and B are multiplied using the arithmetic operator * and the product is stored in the variable C.
Step 3: Print the output.
Here we see 3 different methods for multiplying two numbers:
- Using a multiplication operator
- Using loop and addition operator
- Using recursion and addition operator