C program to find an area of hexagon.

 

01  #include<stdio.h>
02 #include<math.h>
03
04 int main()
05 {
06 int side;
07 float area;
08
09 printf("nEnter the Length of Side : ");
10 scanf("%d", &side);
11
12 area = (3*sqrt(3)*side*side)/2;
13
14 printf("nArea of Regular Hexagon : %.2f", area);
15 return 0;
16 }
 
 OUTPUT :

Enter the Length of Side : 3
Area of Regular Hexagon : 23.38

Related Post

Leave a Reply

Your email address will not be published. Required fields are marked *