Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Example problem statement

Approximate Value
Phineas and Ferb, who live in the fictional town of Danville, think and do innovatively on
weekends. Every day the boys embark on some grand new project, which annoys their
controlling sister, Candace, who tries to bust them. One Sunday, they were both sitting under a
tree in their back yard. They decide to invent a machine which would allow us to enter 2 numbers
and it would say whether one of the entered number is an approximate value of the other number
entered. They decide to insert a program code in the machine.
A number is said to be an approximate value of the other if they differ by utmost 0.5.
So write a program to find whether the given number is Approximate number of other?
Input Format:
Input consists of Two Float type numbers.
Output Format:
Displays whether the number is approximate or not.
[All text in bold corresponds to input and the rest corresponds to output]

Sample Input and output 1:


Enter the Two numbers:
14
14.3
Approximate number

Sample Input and output 2:


Enter the Two numbers:
15
14.8
Approximate number
Sample Input and output 3:
Enter the Two numbers:
13
14.3
Not an Approximate number

You might also like