PROGRAM OF ADDITION
class add
{
public static void main(String[] args)
{
int a=5;
int b=10;
int sum;
sum=a+b;
System.out.println("Addition of A&B="+sum);
}
SEND FREE SMS ALL OVER WORLD AND EARN MONEY FOR YOUR MOBILE RECHARGE CLICK HERE...
IF YOU WANT EARN Rs.9,000PM WITHOUT ANY WORK ....CLICK HERE
//TWO NUMBER ADDITION INPUT AT RUN TIME
import java.util.*;
class add
{
public static void main(String[] args)
{
int a,b,c;
Scanner Sc=new Scanner(System.in);
a=Sc.nextInt();
b= Sc.nextInt();
c=a+b;
System.out.println("c="+c);
}
}
SEND FREE SMS ALL OVER WORLD AND EARN MONEY FOR YOUR MOBILE RECHARGE CLICK HERE...
IF YOU WANT EARN Rs.9,000PM WITHOUT ANY WORK ....CLICK HERE
//TWO NUMBER ADDITION INPUT AT RUN TIME (SECOND TYPE)
import java.io.*;
class add
{
public static void main (String args[]) throws IOException
{
int a,b,c=0;
DataInputStream br= new DataInputStream(System.in);
System.out.println("enter the value of a");
a=Integer.parseInt(br.readLine() );
System.out.println("enter the value3 of b");
b=Integer.parseInt(br.readLine() );
c=a+b;
System.out.println("value of c= "+c);
}
}
class add
{
public static void main (String args[]) throws IOException
{
int a,b,c=0;
DataInputStream br= new DataInputStream(System.in);
System.out.println("enter the value of a");
a=Integer.parseInt(br.readLine() );
System.out.println("enter the value3 of b");
b=Integer.parseInt(br.readLine() );
c=a+b;
System.out.println("value of c= "+c);
}
}
No comments:
Post a Comment