Addition of Two Numbers using java programming language:-
Hey friends in this tutorial we are see how to calculate the sum of two number using java programming with sources code ,
using as bellows input produce the equivalent output
INPUT :-
First Number is = int a=1010 &
Second Number is = int b=1011
Calculate / Store result in Variables in: int c;
Corresponding output like this:
c = a + b;
hence, c = 1010 + 1011;
c = 2021 // this result stored in variable c
public class Addition{
public static void main(String[] args){
int a=1010,b=1011, c;
System.out.println("\n numbers is :-" + "First number is =" + a + "\n Second number is =" + b );
c = a + b ;
System.out.println("Sum of the numbers is =" +c );
}
}
OUTPUT:-
numbers is :-
First number is =1010
Second number is =1011
Sum of the numbers is =2021
three int variable,
Two for store number that we are add using Arithematric Addition (+) Operator to add to operant/variable into Thread Variable
using Assingmen t(=) operator