Friday, May 3, 2019

Pointer - 4

  • Problem Description

    Write a program to convert floating point values into its integral equivalent using pointer

    Input and Output Format:

    All float values are displayed correct to 2 decimal places.

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

    Note: In the floating point value mantissa is more equal or more than 0.50 then add one to the equivalent integer value

    Refer sample input and output for formatting specification
  • Test Case 1

    Input (stdin)
    3.49

    Expected Output
    3
  • Test Case 2

    Input (stdin)
    3.50

    Expected Output
    4
Solution










No comments:

Post a Comment

Parity

Problem Description Ram and Sita playing the parity game. Two types of parity are there. One is odd parity and next is even parity. Ram will...