Wednesday, June 27, 2012

To add two numbers - Run Time


AddRunTime.java


import java.util.Scanner;




public class AddRunTime
{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
int x,y,res;
System.out.println("X : ");
x = scanner.nextInt();
System.out.println("Y : ");
y = scanner.nextInt();
res = x + y;
System.out.println("Sum : " + res);
}
}

0 comments:

Post a Comment