multiplicationin c code example

Example 1: multiplicationin c

/*Program for multiplying two numbers*/
#include <stdio.h>
int main(){
	int a, b, Product; //declare the variables that will be used, a will store the first number, b second number and Product, product.
    printf("Enter the first number: \n"); //Prompts user to enter the first number.
    scanf("%d", &a);//Accepts input and saves it to variable a
    printf("Enter the second number: \n");
    scanf("%d", &b);
    sum = a * b; //Formular to multiply the two numbers.
    printf("Product is %d\n", product);
}

Example 2: multiplication in c

//use the "*"

/*var*/ * /*var*/;

Example 3: multiplication operator in c

int main()
{
	int a = 5;
	int b = 3;
	int num = a * b;
    printf("%d", num);
}

Tags:

Misc Example