adding 2 variable in java
public class sum{
Public static void main(String args[]){
int x=5;
int y=10;
int sum= x+y;
System.out.println("addition of x and y= "+sum);
}
}
adding 2 variable in java
public class sum{
Public static void main(String args[]){
int x=5;
int y=10;
int sum= x+y;
System.out.println("addition of x and y= "+sum);
}
}
add two variables in java
public class Addition{
//simple addition method in Java
public static void main(String args[]){
int x = 1; // initializing first variable with a value
int y = 3; // initializing second variable
int sum = x + y; // new variable which is adding two variables x and y
System.out.println( x + " + " + y + " = " + sum );
// printing the sum of variable on the console
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us