Code Scrappers


Area of Equilateral Triangle C program


              #include<stdio.h>
              #include<stdlib.h>
              #include<math.h>

              void main()
              {
                  int s;

                  float area, r;

                  r = sqrt(3) / 4;

                  printf("\nEnter the Side : ");

                  scanf("%d", &s);

                  area = r * s * s;

                  printf("\nArea is :%f", area);

             }
          



Output

    Enter the Side : 2

    Area is :1.732051