Algorithm


  1. Take Three Variable, number1, number2, summation.
  2. Assign values on number1 and number2.
  3. Make multiplication = number2 * number1.
  4. Print multiplication value.

Code Examples

#1 Multiplication Code Example Basic

Code - C Programming

#include <stdio.h>
int main(){
  int multiplication = 0;
  int number1 = 100, number2 = 2;
  multiplication= number1 * number2;
  printf("Multiplication = %d\n",  multiplication);
  return 0;
}
Copy The Code & Try With Live Editor

Output

x
+
cmd
Multiplication = 200

#2 Multiplication Code Example with Input

Code - C Programming

#include <stdio.h>
int main(){
  int multiplication = 0;
  int number1, number2 = 0;
  printf("Enter Number 1: ");
  scanf("%d", &number1);
  printf("Enter Number 2: ");
  scanf("%d", &number2);
  multiplication= number1 * number2;
  printf("Multiplication = %d\n",  multiplication);
  return 0;
}
Copy The Code & Try With Live Editor

Input

x
+
cmd
5 4

Output

x
+
cmd
Multiplication = 20
Advertisements

Demonstration


Simple Subtraction Progarm in C Programming Example.

First Take three variables - number1, number2 and subtraction.

Then apply the simple algorithm for multiplication program - 

multiplication= number2 * number1;

 

That's the basic multiplication program

Next
Appending into a File in C Programming