Skip to content

Commit

Permalink
Update Oop_Expt_1.java
Browse files Browse the repository at this point in the history
  • Loading branch information
rugvedwagh authored Sep 17, 2021
1 parent a37c320 commit 04cc61d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Oop_Expt_1.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,18 @@ public static void main(String[] args)
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();

Complex c1 = new Complex(x,y);
c1.print();

System.out.println("Enter first complex no, real and then imaginary");
int a= sc.nextInt();
int b = sc.nextInt();

Complex c2 = new Complex(a,b);
c2.print();

Complex c3 = new Complex();

c3 = c3.add(c1, c2);
System.out.println("SUM : ");
c3.print();
Expand All @@ -70,11 +73,11 @@ public static void main(String[] args)
c3.print();

c3 = c3.multiply(c1, c2);
System.out.println("Multiplication : ");
System.out.println("Multiplication is: ");
c3.print();

c3 = c3.Divide(c1, c2);
System.out.println("Divide : ");
System.out.println("Divide is: ");
c3.print();

sc.close();
Expand Down

0 comments on commit 04cc61d

Please sign in to comment.