Multiplication of Two Numbers
Multiplication of Two Numbers
int main() {
int num1, num2, product; // Declare variables to store two numbers and their product
// Perform multiplication
1. Header File:
o #include <stdio.h>: Required for scanf and printf functions to handle input and
output.
2. Variable Declaration:
o int num1, num2, product;: Declares three integer variables. num1 and num2 will
store user inputs, and product will store the result of their multiplication.
3. Input:
o printf("Enter the first number: ");: Prompts the user to input the first number.
o scanf("%d", &num1);: Reads the integer input from the user and stores it in num1.
o product = num1 * num2;: The values of num1 and num2 are multiplied and stored in
the variable product.
5. Output:
6. Return Statement:
Sample Output:
You can compile and run this program using any C compiler:
• Run: ./multiply_numbers