View Code of Problem 1

package pat;

import java.util.Scanner;

public class exercise {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a  = sc.nextInt();
          	int b = sc.nextInt();
		System.out.println(a+b);
	}
	
}
/*
Main.java:5: error: class exercise is public, should be declared in a file named exercise.java
public class exercise {
       ^
1 error
*/

Double click to view unformatted code.


Back to problem 1