Write a program to print the area of a rectangle when the length and breadth is ingut by the
user.
Answers
Answered by
0
Answer:
import java.util.Scanner;
public class Rectangle_Area
{
public static void main (String args[ ])
{
Scanner sc =new Scanner(System.in);
System.out.println("Enter the length:");
int length=sc.nextInt();
System.out.println("Enter the breadth:");
int breadth=sc.nextInt();
int area=length*breadth;
System.out.println("Calculated area is:"+area);
}
}
The output of terminal window is attached
Attachments:
Similar questions
CBSE BOARD XII,
2 months ago
Math,
2 months ago
Computer Science,
2 months ago
Geography,
6 months ago
Math,
11 months ago
Science,
11 months ago