This site javatpoint is very useful for programming languages like JAVA,PYTHON,C,C++, Data Structures etc.Java learning Concept also provides technical materials , which are related to latest technologies. We provides very easy lectures to our viewers from beginning to advance level.We focus logical content instead of theoretical content.

Saturday, 28 October 2017

ADD TWO NUMBER INPUT TWO USER

ADD TWO NUMBER INPUT TWO USER


import java.util.Scanner;
class  Test
{
int a,b,c;
void getdata()
{
System.out.println("enter two number");
Scanner sc=new Scanner(System.in);
a=sc.nextInt();
b=sc.nextInt();
}
void sum()
{
c=a+b;
System.out.println(c);
}
}
class Sample extends Test
{
void multi()
{
c=a*b;
System.out.println(c);
}
public static void main(String args[])
{
Sample ob=new Sample();
ob.getdata();
ob.sum();
ob.multi();
}
}

Adbox