Skip to content

Commit 4427eed

Browse files
How to calculate perimeter of Rectangle
1 parent 8836993 commit 4427eed

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

PerimeterOfRectangle.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.company;
2+
3+
import java.util.Scanner;
4+
5+
public class Main {
6+
7+
public static void main(String[] args) {
8+
9+
Scanner scan = new Scanner(System.in);
10+
11+
System.out.println("ENTER THE LENGTH OF THE RECTANGLE : ");
12+
float l = scan.nextFloat();
13+
14+
System.out.println("ENTER THE LENGTH OF THE RECTANGLE : ");
15+
float b = scan.nextFloat();
16+
17+
float P = 2*(l+b);
18+
System.out.println("PERIMETER OF RECTANGLE IS " +P);
19+
20+
21+
22+
}
23+
}

0 commit comments

Comments
 (0)