Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- float a, b, c, P, p, S;
- printf("a = ");
- scanf("%f", &a);
- printf("b = ");
- scanf("%f", &b);
- printf("c = ");
- scanf("%f", &c);
- P = a + b + c;
- p = (a + b + c)/2;
- S = sqrt(p*(p-a)*(p-b)*(p-c));
- if(a > 0 && b > 0 && c > 0 && a + b > c && a + c > b && b + c > a)
- {
- printf("P = %.2f\n", P);
- printf("S = %.2f\n", S);
- }
- else //if (a < 0 || b < 0 || c < 0 || a + b < c || a + c < b || b + c < a)
- {
- printf("Error");
- }
- if(a == b || b == c ||c == a)
- {
- printf("Triangle is isosceles\n");
- }
- if(a == b && b == c && c == a)
- {
- printf("Triangle is equilateral");
- }
- if()
- {
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement