Here is the simple program to add two numbers and store output in third variable. Given below it the program to add two number which doesn't take input from user. The variables are declared and initialized.
class sum
{
public static void main(String args[])
{
int a, b, c;
a = 10;
b = 20;
c = 30;
System.out.print("Sum of the given number is : "+c);
}
}
class sum
{
public static void main(String args[])
{
int a, b, c;
a = 10;
b = 20;
c = 30;
System.out.print("Sum of the given number is : "+c);
}
}
0 Comments:
Post a Comment