Advertisement
SAADQUAMER

Triangle

Jun 8th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. // C program to input angles of a triangle and check whether triangle is valid or not.
  2.  
  3. #include<stdio.h>
  4. int main(){
  5.  
  6. int A1,A2,A3,total;
  7. printf("INPUT THE ANGLES :");
  8. scanf("%d%d%d",&A1,&A2,&A3);
  9. total=A1+A2+A3;
  10. if(total == 180 && A1 != 0 && A2 != 0&& A3 != 0 )
  11. {
  12.     printf("Triangle is valid\n");
  13. }
  14. else printf("Triangle is not valid\n");
  15.  
  16. return 0;
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement