Sunday, 19 February 2017

IO 21

QUESTION DESCRIPTION :


Write a program to convert a floating point number into corresponding integer

Input and Output Format:

Refer sample input and output for formatting specification.

All float values are displayed correct to 2 decimal places.

All text in bold corresponds to input and the rest corresponds to output.


TEST CASE 1


INPUT

12.01

OUTPUT

The integer variant of 12.01 is=12


TEST CASE 2


INPUT

23.00

OUTPUT

The integer variant of 23.00 is=2


EXPLANATION :


The objective of this code is to accept a float value from the user and print its integer counterpart.


ALGORITHM :

  • Accept a float value from the user ( f )
  • Convert the float value to integer ( Type Casting )
  • Print the output value in the required format.
SOLUTION : (Please use this as reference only)

CODE





No comments:

Post a Comment