View Code of Problem 1

package com.sum;

import java.util.Scanner;

public class Sum {  
	public static void main(String[] args){

	   Scanner sc = new Scanner(System.in);
	   int A=sc.nextInt();
	   int B=sc.nextInt();
	   int c=A+B;
	   System.out.println(c);
    }

}
/*
Main.java:5: error: class Sum is public, should be declared in a file named Sum.java
public class Sum {  
       ^
1 error
*/

Double click to view unformatted code.


Back to problem 1