Write a recursive algorithm which takes floating number as input and displays real and
integer part seperately.
Answers
Answered by
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
Hindi,
5 months ago
Math,
5 months ago
India Languages,
5 months ago
Computer Science,
11 months ago
Chemistry,
11 months ago
French,
1 year ago
Computer Science,
1 year ago
Hindi,
1 year ago