Java GetArgument dan Operasi Aritmatika

GETARGUMENT

public class GetArgument{
public static void main(String[]args){
int y=0
for(y=0;y<5:y++){
System.out.println(args[y]+" ");
}
}}

OPERASI ARITMATIK

public class operasiaritmatik{
public static void main(String[]args){
int n1=Integer.parseInt(args[0]);
int n2=Integer.parseInt(args[0]);
int tambah = n1+n2;
int kurang = n1-n2;
int kali = n1*n2;
int bagi = n1/n2;
System.out.println("Sum : "+tambah);
System.out.println("Difference : "+kurang);
System.out.println("Product : "+kali);
System.out.println("Quotient : "+bagi);}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s