Computer Science, asked by kaushikkusum72, 9 months ago

Write a recursive algorithm which takes floating number as input and displays real and
integer part seperately.

Answers

Answered by Anonymous
0

The algorithm that takes floating number as input and displays real and

integer part separately is as follows:

class Maths

{

    public static void main(String args[])

    {

         double x = 7.3;

         int y = (int)Math.floor(a);

         double z = x - b;    

         System.out.println("Integral part = " + y);

         System.out.println("Fractional part = " + z);

     }

}

Similar questions