Sunday 8 June 2014

A simple program in java to add two numbers

// this program adds two numbers a and b and stores the result in another variable c;


public class sum
{
public static void main(String[] args)
{
int a,b,c;
a=5;
b=3;
c=a+b;
System.out.print("sum = "+c);

}

}


output:
sum = 8

No comments:

Post a Comment

SAY HELLO!!