‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S
LENGTH .



‘ C’ PROGRAME TO SHOW THE TYPE OF TRANGLE BY ACCEPTING IT’S LENGTH ...

Answer / Vicky Kumar Gupta

Here's a simple C program that classifies a triangle based on its side lengths. This program assumes that the input sides are sorted in ascending order (a <= b <= c).n```cn#include <stdio.h>nnvoid checkTriangle(int a, int b, int c)n{n if (a + b > c && b + c > a && a + c > b) {n printf("The input is a valid triangle.");n if (a == b && b == c) {n printf(" The triangle is equilateral. n" );n } else if (a == b || b == c || a == c) {n printf(" The triangle is isosceles. n" );n } else {n printf(" The triangle is scalene. n" );n }n }n else {n printf("The input is not a valid triangle.");n }n}nnint main() {n int side1, side2, side3;nnprintf("Enter three sides of a triangle: ");nscanf("%d %d %d", &side1, &side2, &side3);ncheckTriangle(side1, side2, side3);nreturn 0;n}n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

How does the C program handle segmentation faults?

2 Answers  


Write a program to find minimum between three no.s whithout using comparison operator.

4 Answers   IBM,


which is conditional construct a) if statement b) switch statement c) while/for d) goto

1 Answers  


Why do we use & in c?

1 Answers  


What is #line used for?

1 Answers  


what is a NULL pointer?

2 Answers  


What is 02d in c?

1 Answers  


What is a constant and types of constants in c?

1 Answers  


7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

1 Answers  


c program to manipulate x=1+3+5+...+n using recursion

2 Answers   Wipro,


Why do we need arrays in c?

1 Answers  


Eight queens puzzle

0 Answers  


Categories