Advertisement
afrinahoque

If the triangle is valid or not

Jun 10th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int x,y,z,sum;
  5.     printf("Enter the angles of the triangle:\n");
  6.     scanf("%d%d%d", &x, &y, &z);
  7.     sum=x+y+z;
  8.     if(sum==180 && x!=0 && y!=0 && z!= 0)
  9.     {
  10.         printf("Triangle is valid.");
  11.     }
  12.     else
  13.     {
  14.         printf("Triangle is not valid.");
  15.     }
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement