Selasa, 12 April 2011

Program rata-rata dengan JAVA


Berikut codenya Program rata-rata
class rata-rata
{
public static void main (String[]args)
{
int a= 10;
int b= 20;
int c= 45;
system.out.println("number="+ a);
system.out.println("number="+ b);
system.out.println("number="+ c);
system.out.println("rata-rata="+(a+b+c)/3);
}
}

Tidak ada komentar:

Posting Komentar