how to get product of two numbers

+2 votes
asked Aug 5, 2019 by anonymous

11 Answers

+1 vote
answered Aug 5, 2019 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, 2019 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, 2019 by (300 points)

For Python,

a=14

b=5

print(a*b)

It will result in 70

0 votes
answered Sep 11, 2019 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 Sep 11, 2019 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 Sep 12, 2019 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);

}
0 votes
answered Sep 17, 2019 by (140 points)
void main()

{

int a,b;

printf("enter two number ");

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

printf("product is : %d",a*b);

}
0 votes
answered Sep 20, 2019 by Sanjeev sagar
#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,sum,n;

printf("Enter the two number for there product");

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

sum=a*b;

printf("%d",sum);

getch();

}
0 votes
answered Sep 20, 2019 by R Pugazhendhi
int main ()

{

int num1;

int num2;

printf("enter the num1:")

scanf("%d",num1);

printf("enter the num2:")

scanf( "%d",num2)

printf(%d,num1*num2)

return 0

}
0 votes
answered Sep 20, 2019 by anonymous
what is meaning of product ?

Ans:- multiplcation of two numbers(a*b)

same thing should be done in programming way with syntax

main()

{

int a,b;

printf("enter the two nos");

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

printf("product is %d ",a*b);

}
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.
...