write a java program to find the area of a rectangle
Answers
Answer:
import java.util.*;
class area{
public static void main() {
Scanner sc = new Scanner(System.in);
System.out.println("Please enter length of rectangle:");
double length = sc.nextDouble();
System.out.println("Please enter breadth of rectangle:");
double breadth = sc.nextDouble();
double area = length*breadth;
System.out.println("Area of rectangle is " + area);
}
}
//Hope this helps! If it does, please mark it brainliest! Thanks :D
Answer:import java.util.Scanner;
public class Rectangle
{void display()
{Scanner SC=new Scanner(System. in);
System.out.println("Enter length and breadth");
int l=SC.nextInt();
int b=SC.nextInt();
System. out. println("Area of rectangle is:"+(l*b));
}
}
Please mark it as the brainliest answer!