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).

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
Get step-by-step solutions from verified subject matter experts
