how to get product of two numbers

+1 vote
asked Aug 5 by anonymous

6 Answers

+1 vote
answered Aug 5 by (1,600 points)
To get the multiplication of two numbers simply use the binary operator * (asterisk) to multiply two numbers, constants or variables.

int variable1 = 10, variable2 = 20;

printf("%d", variable1 * variable2);

or you could store it in another variable.

variable3 = variable1 * variable2;
+2 votes
answered Aug 5 by (180 points)
#include<stdio.h>

#include<conio.h>

#include<math.h>

int main(

int a,b,mul;

printf("Enter the two number");

scanf("%d%d",&a,&b);

mul=a*b;

printf("The product of two number is %d",mul);

return 0;

}
+1 vote
answered Aug 6 by (300 points)

For Python,

a=14

b=5

print(a*b)

It will result in 70

0 votes
answered 4 days ago by anonymous
  • simple way to solve the product of two numbers.

first declare three variables like a,b,c.And then read the values.After that perform product between them.we take c as storing the product.

PROGRAMME;

#include<stdio.h>

​​int main()

{

int a,b,c;

printf("enter a,b values");

scanf("%d",&a,&b);

c=a*b;

printf("%d",c);

}

0 votes
answered 4 days ago by (140 points)
#include<stdio.h>

int main()

{

int a,b,p;

printf("enter two numbers a and b");

scanf("%d%d",&a,&b);

p=a*b;

printf("product is: %d",p);

return 0;

}
0 votes
answered 4 days ago by (140 points)
#include<stdio.h>

int main()

{

int a,b,c;

printf("enter a no");

scanf("%d %d",&a,&b);

c=a*b;

printf("the product of two no is %d,c);

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...