Friday, November 1, 2019

                                                                 E-BOX    

                          BASICS OF C PROGRAMMING   

Conditional Statements :-  Code Analysis

 PROBLEM  - 1:                                                      

                                                        Approximate Value

 Phineas and  Ferb, who live in the fictional town of Danville,think and do innovative things on weekends.Every day the boys embark on a 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



SOLUTION :




No comments:

Post a Comment

                                                 E-BOX                                                     BASICS OF C PROGRAMMING       i -...

https://amzn.to/2LAmadv