class Mortgage{
public static void main(String[]args){
int rateOfInterest = 6;
float monthlyRoi = (rateOfInterest/100)*12;
System.out.print("Rate of Interest : "+ monthlyRoi);
}
}
I am not getting proper output
Under discussion
Comments (3)
- Popular
- New
- Old
You must be signed in to leave a comment
Pavel Naumovich
26 October 2020, 06:58
You are welcome
0
Pavel Naumovich
25 October 2020, 19:41useful
Even though you saving result into a float , you still using integers in your expression, which would mean that result will be an integer.
try
float monthlyRoi = (rateOfInterest/100.00f)*12
or you can use cast and cast
float monthlyRoi = ( (float) rateOfInterest/100)*12
+1
Dinesh
26 October 2020, 05:52
Thank You
0