Calculations

Python program to multiply two numbers

Python program to multiply two numbers

In this tutorial, we will discuss Python program to multiply two numbers.

In this topic, we will learn how to multiply two integer number in the Python programming language

multiply two integer numbers

num1=int(input("Enter the first number: "))
#input value for variable num1
num2=int(input("Enter the second number: "))
#input value for variable num2
mul=num1*num2;
#perform multiplication operation
print("the product of given numbers is: ",mul)
#display the product

When the above code is compiled and executed, it produces the following results

Enter the first number: 23
Enter the second number is: 32
the product of the given numbers is 736

This is a simple Python program to find the product of two integer numbers.

In the above program, we declared two different integer values such as  12 and 32 stored in variables num1, num2, respectively.
Then, we can find the product of given numbers using the * operator in Python

finally, we could display the result on the screen using the print() function in Python language.

multiply two floating point numbers

num1=float(input("Enter first number: "))
#input value for variable num1
num2=float(input("Enter second number: "))
#input value for variable num2
mul=num1*num2;
#perform multiplication operation
print("the product of given numbers is:",mul)
#display the product

When the above code is compiled and executed, it produces the following results

Enter first number: 3.43
Enter second number:21.2
product of given numbers is: 72.716

This is a simple Python program to find the product of two floating point numbers.

In the above program, we declared two different floating point values such as  3.43 and 21.2 stored in variables num1, num2, respectively.
Then, we can find the product of given numbers using the * operator in Python

finally, we could display the result on the screen using the print() function in Python language.

 

 

 

Similar post

C++ program to multiply two numbers using function

Java program to multiply two numbers using method

Python program to multiply two numbers using function

C# program to multiply two numbers using function

PHP program to multiply two numbers using function

 

Find product of two numbers using method in Java

Find product of two numbers using recursion in Java

 

C program to multiply two numbers 

C++ program to multiply two numbers

Java program to multiply two numbers 

Python program to multiply two numbers 

C# program to multiply two numbers 

PHP program to multiply two numbers 

JavaScript program to multiply two numbers 

 

Calculate the total of array elements in Java

Calculate the total of array elements in C

Calculate the total of array elements in C++

Java program to calculate sum of array elements

C program to calculate sum of array elements

Java Program to calculate average of array

C Program to calculate average of array

Java Program to calculate average of odd and even numbers in an array

Java Program to calculate average of odd and even numbers

C Program to calculate average of odd and even numbers in an array

C Program to calculate average of odd and even numbers

C++ Program to calculate average of odd and even numbers in an array

C++ Program to calculate average of odd and even numbers

 

 

 

Suggested for you

Operator in Python

Data types in Python

Operator in C language

for loop in C language

Single dimensional array in C language

Data type and variable in C language

Operator in C++ language

For loop in C++ language

Single dimensional array in C++ language

The data type in C++ language

Operator in Java

for loop in Java

Single dimension array in Java

 

 

CPP program to multiply two numbers
C program to multiply two numbers using function
Karmehavannan

I am Mr S.Karmehavannan. Founder and CEO of this website. This website specially designed for the programming learners and very especially programming beginners, this website will gradually lead the learners to develop their programming skill.

View Comments

  • Hello, how do I multiply an integer by a number, because i am making a program in python where you type your age then it shows you your age in years, months and days. when i try and do the command months = age*12 and do print("You are", months,"in months") it just outputs the age 12 times.

Recent Posts

Explanation of one dimensional array (Data structure)

Explanation of one dimensional array In this post, we will discuss the concept of "Explanation…

2 days ago

Python program to calculate the sum of odd and even numbers in a list

Python program to calculate the sum of odd and even numbers in a list In…

5 days ago

Python code to Calculate sum of odd and even in a list

Python code to Calculate sum of odd and even in a list In this tutorial,…

1 week ago

How to find reverse number using method in Java

How to find reverse number using method In this article, we will discuss the concept…

2 weeks ago

C# inverted full pyramid star pattern

C# inverted full pyramid star pattern In this article, we will discuss the concept of…

1 month ago

C# Full Pyramid star pattern program

C# Full Pyramid star pattern program In this article, we will discuss the concept of…

2 months ago