Please enable JavaScript.
Coggle requires JavaScript to display documents.
Program to add two numbers ((class f ({ (public static void main(String…
Program to add two numbers
class f
{
public static void main(String args[])
{
int a,b,sum=0;
a=10;b=20;
sum=a+b;
System.out.println("sum is "+sum);
}
}
import java.util.Scanner;
class f
}
{
public static void main(String args[])
}
{
System.out.println("sum is "+sum);
sum=a+b;
b = keyboard.nextInt( );
System.out.println("Enter the value of b");
a = keyboard.nextInt( );
System.out.println("Enter the value of a");
Scanner keyboard = new Scanner (System.in);
int a,b,sum=0;