From 8f5433140c689b46697010834b6af1108854e4fc Mon Sep 17 00:00:00 2001 From: ritikdongre <71232003+ritikdongre@users.noreply.github.com> Date: Sun, 27 Sep 2020 05:39:02 +0530 Subject: [PATCH] Update Exercise 3.4.java --- week 3/Exercise 3.4.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/week 3/Exercise 3.4.java b/week 3/Exercise 3.4.java index c0f6283..3380bc9 100644 --- a/week 3/Exercise 3.4.java +++ b/week 3/Exercise 3.4.java @@ -11,16 +11,13 @@ static int multiply(int a, int b){ //static method public class Test3{ public static void main( String[] args ) { Scanner sc = new Scanner(System.in); - int n1=sc.nextInt(); - int n2=sc.nextInt(); + int n1=sc.nextInt(); + int n2=sc.nextInt(); + QuestionScope q = new QuestionScope(); //Called the method sum() to find the sum of two numbers. - QuestionScope q = new QuestionScope(); - int sum; - sum= q.sum(n1,n2); + System.out.println(q.sum(n1,n2)) //Called the method multiply() to find the product of two numbers. - int multy= q.multiply(n1,n2); - System.out.println(sum); - System.out.print(multy); + System.out.print(q.multiply(n1,n2)); } -} \ No newline at end of file +}