Hello Friends !!
Here you can see how to take input from the user :
-> First of all you have to call input/output Package named "java.io." .
-> Here is the Program :
import java.io.;
class input
{
public static void main(String args[]) throws Exception
{
int m1,m2,total;//Local Variables
DataInputStream ds;
m1=00;//if user not enter any value then it will assign 0.
m2=00;
ds = new DataInputStream(System.in);//creating object of inputstream
System.out.println("Enter the m1:");
m1=Integer.parseInt(ds.readLine());//taking input from user
System.out.println("Enter the m2:");
m2=Integer.parseInt(ds.readLine());
total=m1+m2;
System.out.println("The addition is:"+total);
}
}
-> Save this Program as input.java .
-> Thank you .
thanks bharat
very good
Thanks kushal. Pan tara jevu hu na banavi saku.
Nice work keep it up...!!