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 +}