Assignment #124
Code
/// Name: Mahima Choudhary
/// Period: 6
/// Program Name: Summing Three Numbers
/// File Name: SumThreeNums.java
/// Date Finished: 5/13/2016
import java.io.File;
import java.util.Scanner;
public class SumThreeNums {
public static void main(String[] args) throws Exception {
int a, b, c;
Scanner fileIn = new Scanner(new File("3nums.txt"));
a = fileIn.nextInt();
b = fileIn.nextInt();
c = fileIn.nextInt();
fileIn.close();
int sum = a + b + c;
System.out.println("\n" + a + " + " + b + " + " + c + " = " + sum);
System.out.println();
}
}
Picture of the output