+ 1

Java

public class Program { public static void main(String[] args) { int i=410000,t=3.2% double a; a=i*t; System.out.println ("int="+ a); } } Pls can i know what mistake in my program. I don’t get the output

25th Oct 2018, 11:24 AM
Jothika
Jothika - avatar
2 Réponses
+ 3
t=3.2% what you want to do here?
25th Oct 2018, 11:46 AM
Tanay
Tanay - avatar
+ 2
so you want to fins t% of i right ? using % in 3.2% doesnt mean you store a 3.2 percent in Variable. instead use a normal calculation to find it. (i*t/100) or simple store t as (3.2/100) then a=i*t
25th Oct 2018, 11:58 AM
Taste
Taste - avatar