Type the programs in NOTEPAD or DOS prompt itself, for Consol Application.
Type in NETBEANS or ECLIPSE for Window Application.
Here after , I am just typing the programs only..to know more about it , refer
Type in NETBEANS or ECLIPSE for Window Application.
Here after , I am just typing the programs only..to know more about it , refer
Introduction to JAVA
before doing any JAVA Programs.
*********************************************************************************************
Refer Sum(predefined values) also.
*********************************************************************************************
import java.io.*;
Refer Sum(predefined values) also.
*********************************************************************************************
import java.io.*;
class Adduser
{
public static void main(String args[])
{
int a,b,sum;
try
{
DataInputStream x=new DataInputStream(System.in);
System.out.println("Enter two numbers :");
a=Integer.parseInt(x.readLine());
b=Integer.parseInt(x.readLine());
sum=a+b;
System.out.println("Addition= "+sum);
}
catch(Exception e)
{
}
}
}
=========================================================================
Output :
Enter two numbers :
30
20
Addition=50.
No comments:
Post a Comment