Q.1 Wrie the Java Programs for the following
a) Calculate area of rectangle and perimeter of the rectangle. (Hint area of rectangle=length *breadth perimeter=2(length+breadth)
plz solve urgent
Answers
Answered by
4
Answer:
/**
* @author: BeginnersBook.com
* @description: Program to Calculate Area of rectangle
*/
import java.util.Scanner;
class AreaOfRectangle {
public static void main (String[] args)
{
Scanner scanner = new Scanner(System.in);
System.out.println("Enter the length of Rectangle:");
double length = scanner.nextDouble();
System.out.println("Enter the width of Rectangle:");
double width = scanner.nextDouble();
//Area = length*width;
double area = length*width;
System.out.println("Area of Rectangle is:"+area);
}
Step-by-step explanation:
pls mark this as BRAINLIEST guys
Similar questions
Social Sciences,
2 months ago
English,
2 months ago
Social Sciences,
2 months ago
Hindi,
5 months ago
Math,
9 months ago
Biology,
9 months ago