Quick actions

cmd+k|ctrl+k

Navigation

Languages

sixArea

Snippet info

Language

Java

Visibility

public

Author

shin

Created

2022-03-22T01:47:20.624047Z

Updated

2022-03-22T01:47:20.624047Z

import java.util.Scanner;
class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        System.out.print("Enter the side: ");
        double n = in.nextDouble();
        double ans = 3*Math.sqrt(3)*n*n/2;
        System.out.printf("The area of the hexagon is %.4f", ans);
    }
}
INFO