repl.it
@Hariz_Hazril/

🏫School Project - purata 3 nombor

Java

No description

fork
loading
Files
  • Main.java
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import java.util.Scanner;
public class Main {
	public static void main (String[]args) {
		Scanner input = new Scanner(System.in);
		System.out.print("Masukkan nombor 1 : ");
    double no1 = input.nextDouble();
		System.out.print("Masukkan nombor 2 : ");
    double no2 = input.nextDouble();
		System.out.print("Masukkan nombor 3 : ");
    double no3 = input.nextDouble();
		double purata = (no1+no2+no3)/3;
		System.out.print("Purata 3 nombor ialah : "+purata);
	}
}