Thursday, 23 August 2018

Contoh Script Java Menghitung rata-rata


public class Latihan
{
                public static void main (String []args)
                {
                                int number1=10;
                                int number2=20;
                                int number3=15;
                                int rata_rata;
                               
                                System.out.println("Number 1 :" +number1);
                                System.out.println("Number 2 :" +number2);
                                System.out.println("Number 3 :" +number3);
                                rata_rata = (number1+number2+number3 )/3;
                               
                                System.out.println("Rata-rata :" +rata_rata);
                               
                }
}




download script disini

No comments:

Post a Comment