this is a sample program to compute two numbers and get the sum.
i hope you learn and enjoy....
import java.io.*;
import java.util.Scanner;
public class Computation
{
public static void main(String args[])
{
Scanner input=new Scanner(System.in);
int num1,num2,sum=0;
System.out.print("Enter first number:");
num1=input.nextInt();
System.out.print("Enter second number:");
num2=input.nextInt();
sum=num1 + num2;
System.out.println("The sum is:" + sum);
}
}
Showing posts with label Compute two number and get the sum. Show all posts
Showing posts with label Compute two number and get the sum. Show all posts
Thursday, November 25, 2010
Thursday, June 24, 2010
Flowcharting Problem and Solution
This is a sample flowchart and algorithm solution to the problem compute two numbers and get the sum.
this a good steps to solve the problem in programming.
this a good steps to solve the problem in programming.
Subscribe to:
Posts (Atom)
