Write a program to find and print areas of rectangle
(Java)
Answers
Answered by
1
Answer:
import java. util. Scanner; class AreaOfRectangle.
public static void main(String args[]) {
Scanner s= new Scanner(System. in);
double l= s. nextDouble(); System. out. println("Enter the breadth:");
double b= s. nextDouble();
System. out. println("Area of Rectangle is: " + area); }
Answered by
5
Hey there!
The program is as follows:
import java.util.*;
class RectangleArea
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter the length and breadth of square");
int l = sc.nextInt();
int b = sc.nextInt();
int ar = l*b;
System.out.println("Area of square is "+ ar);
}
}
Hope it Helps You!
Similar questions