0

Calculating acceleration Java??? Doesnt work

public class main { public static void main(String[] args) { int s=9; int t=3; int a; int v; if(s>0) v=s/t a=v/t; System.out.print(a); } }

11th Mar 2020, 5:51 AM
Angel Halili
Angel Halili - avatar
3 ответов
+ 1
Angel Halili For multiple line of code in if or else statement you should use curly braces {}. For example: if(10 > 0) { System.out.print("Angel "); System.out.println("Halili"); } else { System.out.print("AJ "); System.out.println("Anant"); }
11th Mar 2020, 6:09 AM
A͢J
A͢J - avatar
0
Thanks.
11th Mar 2020, 5:59 AM
Angel Halili
Angel Halili - avatar