Untitled
unknown
plain_text
a year ago
587 B
3
Indexable
Never
#include <stdio.h> #include <stdlib.h> #include <math.h> int main() { float a, b, c, p; printf(" pls enter the first edge of triangle:"); scanf("%f", &a); printf(" pls enter the second edge of triangle:"); scanf("%f", &b); printf(" pls enter the third edge of triangle:"); scanf("%f", &c); if (a, b, c <=0){ printf("these three numbers must be a positive number!"); } else { printf("\n the perimeter of the triangle is %f", a+b+c); p= (a+b+c)/2; printf("\n the are of the triangle is %f", sqrt(p*(p-a)*(p-b)*(p-c)) ); } return 0; }