SHARE
TWEET

Problem - 6 : Triangle is valid or not.

a guest May 24th, 2019 94 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>  
  2.  
  3. int main()  
  4. {  
  5.     int a,b,c,valid = 0;
  6.  
  7.     printf("Enter three sides of triangle : ");  
  8.     scanf("%d %d %d", &a, &b, &c);  
  9.      
  10.     if((side1 + side2) > side3)
  11.        
  12.     {  
  13.        
  14.         if((side2 + side3) > side1)
  15.          
  16.         {
  17.              
  18.             if((side1 + side3) > side2)
  19.            
  20.             {  
  21.                
  22.                 valid = 1;
  23.                
  24.             }
  25.    
  26.         }
  27.        
  28.     }  
  29.    
  30.     if(valid == 1)
  31.        
  32.     {
  33.        
  34.         printf("Triangle is valid\n");
  35.    
  36.     }
  37.    
  38.     else
  39.        
  40.     {
  41.        
  42.         printf("Triangle is not valid\n");
  43.    
  44.     }
  45.  
  46.     return 0;  
  47. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top