To multiply two numbers in C, you can use the '*' operator.
In this example,
num1
and num2
and assign them the numbers to be multiplied.*
operator and store the result in a variable product
.product
.#include <stdio.h>
int main() {
int num1 = 5;
int num2 = 10;
int product = num1 * num2;
printf("Product of %d and %d is: %d\n", num1, num2, product);
return 0;
}
Product of 5 and 10 is: 50
In this tutorial, we learned How to Multiply Two Numbers in C language with well detailed examples.