0
What is the problem with my code?
I've wrote this program, but I got every time when I run it 0.0 but I don't know how. Here is the program: import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner input = new Scanner(System.in); int houses = input.nextInt(); double chances = 0.0; //your code goes here double no1 = 2 / houses; double no2 = no1 *100; chances = no2; System.out.println(Math.ceil(chances)); } }
1 Respuesta
+ 2
Kovács Levente do Math.round after Math.ceil and check condition for houses which should be greater than or equals to 3.