Write a java program to find the area of rectangle?
Answers
Answered by
3
double length= Double.parseDouble(jTextfield1.geText());
double breadth= Double.parseDouble(jTextfield2.geText());
double area = length× breadth;
jTextfield3.setText(" "+ area);
double breadth= Double.parseDouble(jTextfield2.geText());
double area = length× breadth;
jTextfield3.setText(" "+ area);
Answered by
3
import java.io.*;
import java.lang.*;
import java.util.*;
class area
{
public static void main (String arts[ ])throws IOException
{int l,b,a=0;
Scanner sc=new Scanner (System.in);
System.out.println("Enter length=");
l=next.Int();
System.out.println("Enter breadth=");
b=next.Int();
a=l*b;
System.out.println("Area of rectangle="+a);
}
}
Hope it helps^_^
import java.lang.*;
import java.util.*;
class area
{
public static void main (String arts[ ])throws IOException
{int l,b,a=0;
Scanner sc=new Scanner (System.in);
System.out.println("Enter length=");
l=next.Int();
System.out.println("Enter breadth=");
b=next.Int();
a=l*b;
System.out.println("Area of rectangle="+a);
}
}
Hope it helps^_^
Similar questions
Physics,
8 months ago
Math,
8 months ago
Political Science,
8 months ago
Computer Science,
1 year ago
Hindi,
1 year ago
English,
1 year ago
Biology,
1 year ago
Hindi,
1 year ago