Mga bro, naa koy problem bah.
I have this C program and I need to perform the square root operation para sa area of a triangle using Heron's formula. Mao ning program nako ay:
Code:
#include<stdio.h>
#include<conio.h>
void main(void)
{
int a, b, c;
float s, dividend, area;
clrscr();
printf("Enter 3 numbers separated by space for the sides of the triangle: ");
scanf("%d %d %d", &a, &b, &c);
s=(a+b+c)/2;
dividend=s*(s-a)*(s-b)*(s-c);
if (dividend<0)
printf("The given sides do not represent a triangle");
else
{
area=????????
printf("Area of the triangle: %.2f", area);
}
getch();
}
Thanks mga Bro!