class file_name{
public static void main(String ar[]){
int a = Integer.parseInt(ar[0]);
int b = Integer.parseInt(ar[1]);
String s = ar[2];
int sum;
sum = a+b;
System.out.println(a);
System.out.println(b);
System.out.println(s);
System.out.println("Sum is : "+sum);
}
}
OutPut
-----------------
open your Command Prompt
then Compile the Program
and then after run like
java file_name 10 20 Anjan
the OutPut will come
10
20
Anjan
Sum is : 30
public static void main(String ar[]){
int a = Integer.parseInt(ar[0]);
int b = Integer.parseInt(ar[1]);
String s = ar[2];
int sum;
sum = a+b;
System.out.println(a);
System.out.println(b);
System.out.println(s);
System.out.println("Sum is : "+sum);
}
}
OutPut
-----------------
open your Command Prompt
then Compile the Program
and then after run like
java file_name 10 20 Anjan
the OutPut will come
10
20
Anjan
Sum is : 30
No comments:
Post a Comment