fork download
  1. #include <stdio.h>
  2.  
  3. // Function to check if three sides can form a triangle
  4. void checkTriangle(int a, int b, int c) {
  5. if (a + b > c && b + c > a && a + c > b)
  6. printf("Triangle\n");
  7. else
  8. printf("Not Triangle\n");
  9. }
  10.  
  11. int main() {
  12. int t, a, b, c;
  13. printf("Enter number of test cases for Triangle check: ");
  14. scanf("%d", &t);
  15.  
  16. for (int i = 0; i < t; i++) {
  17. printf("Enter three sides (a b c): ");
  18. scanf("%d %d %d", &a, &b, &c);
  19. checkTriangle(a, b, c);
  20. }
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0s 5280KB
stdin
Standard input is empty
stdout
Enter number of test cases for Triangle check: