Hello There, Guest! Login Register
Advertise Here | Remove Ads

C Program to Calculate Area of Equilatral Triangle

  • 0 Vote(s) - 0 Average


06-06-2016, 12:27 PM #1
Mitu Offline FFU SENIOR FFU SENIOR
VIP MEMBER
Posts:2,183 Threads:175 Joined:Sep 2014 Reputation: 2 Sex Female
FFUC: $0
Country: Bangladesh
Code:
#include<stdio.h>
#include<math.h>

int main() {
  int side;
  float area, r4;

  r4 = sqrt(3) / 4;

  printf("\nEnter the Length of Side : ");
  scanf("%d", &side);

  area = r4 * side * side;

  printf("\nArea of Equilateral Triangle : %f", area);
  return (0);
}

Output :
Quote:Enter the Length of Side : 5
Area of Equilateral Triangle : 10.82

[Image: 468x60_2.gif]






Forum Jump:


Users browsing this thread:1 Guest(s)

Advertise Here | Remove Ads