Skip to content

Commit 18fb141

Browse files
Second contribution
1 parent 4427eed commit 18fb141

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

AreaSquare.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.company;
2+
3+
import java.text.DecimalFormat;
4+
import java.util.Scanner;
5+
6+
public class Main {
7+
8+
public static void main(String[] args) {
9+
// TO FIND AREA OF SQUARE
10+
Scanner side = new Scanner(System.in);
11+
DecimalFormat df=new DecimalFormat(".##");
12+
System.out.println("Enter Side Of Square = ");
13+
float s =side.nextFloat();
14+
float area = (s*s);
15+
System.out.print("Area ="+df.format(area));
16+
17+
}
18+
}

0 commit comments

Comments
 (0)