Soal UTS yang dijadikan salah satu contoh program di java
public class coba
{
public
static void main (String [] args)
{
double
a=3.2;
double
b=6.0;
double
c=1.5;
int
x=4;
int
y=63;
int
z=17;
System.out.println("A
= "+a);
System.out.println("B
= "+b);
System.out.println("C
= "+c);
System.out.println("X
= "+x);
System.out.println("Y
= "+y);
System.out.println("Z
= "+z);
System.out.println("A=
0.5*A = "+( 0.5*a));
System.out.println("B=
A/4 ="+(a/4));
System.out.println("X=
X + 1="+(x+1));
System.out.println("Y=
X*2 = "+(x*2));
System.out.println("C=
C - A - B= "+(c-a-c));
}
}
Keluarnya yaitu
Tidak ada komentar:
Posting Komentar