Question: Here is a java code to find the sum of two integer number. The first line of input n is the number of cases. The

Here is a java code to find the sum of two integer number.

The first line of input n is the number of cases. The next n lines contains int a and int b. The program will find the sum of a and b.

Now write a shell script and name it sum.sh. It will take three file, first one contain the inputs as described above. the second file will contain the outputs(one output per line).

Here is a java code to find the sum of two integer

import java.util.*; public class Test { Run | Debug public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while(n-- >0) { int a = sc.nextInt(); int b = sc.nextInt(); System.out.println(a+b); } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!