Dremendo Tag Line

Input 2 decimal numbers and find the floor value of their sum using mathematical functions in Python

Mathematical Functions - Question 4

In this question, we will see how to input 2 decimal numbers and find the floor value of the sum of the numbers in Python programming using the mathematical functions. To know more about mathematical functions click on the mathematical functions lesson.

Q4) Write a program in Python to input 2 decimal numbers and find the floor value of the sum of the numbers.

Program

import math

print('Enter 2 decimal numbers')
a=float(input())
b=float(input())
s=a+b
x=math.floor(s)
print('Floor value of sum = %d' %(x))

Output

Enter 2 decimal numbers
12.36
8.47
Floor value of sum = 20
video-poster