Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
31 changes: 31 additions & 0 deletions kashish/kashish.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import java.lang.*; // importing this package for Scanner class
class Calc{ // creating class
float result=0; //intializing variable
void add(int a,int b) { //creating method
result=a+b;
System.out.println ("Sum is
"+result) ;}
void sub (int a,int b) {
result=a-b;
System.out.println("Dif. is "+result);}
void mul(int a,int b) {
result=a×b;
System.out.println("Product is "+result);}
void div(int a,int b){
result=a/b;
System.out.println("Division is "+result);}
public static void main(String args [])
{Calc c = new Calc();
int a= Integer.parseInt (args [0]);
int b= Integer.parseInt (args [2]) ;
char ch=args[1].charAt(0) ;
if (ch=='+'){
c. add (a, b) ;}
else if (ch==
c. sub (a, b) ;}
else if (ch=='@') {
c.mul (a, b) ; }
else if (ch=='/'){
c.div (a, b) ;}
}
}