Pages

Pages

Program for adding two numbers.

03 Java Operators.
Program for adding two numbers:
//AddingTwoInts.java 
class AddingTwoInts 
  {
public static void main(String[] args) 
{
int a = 60;
int b = 70;

int c = a + b;

System.out.println("The addtion of " + a + " and " + b + " is " + c);
}
   } 
 Out Put: 
     The addition of 60 and 70 is 130

Home 
 1 
 2 
 3 
 4 
 5 
 6 
 7 
 8 
 9 
 10 
 Next

No comments:

Post a Comment