‘ 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 |
How does the C program handle segmentation faults?
Write a program to find minimum between three no.s whithout using comparison operator.
which is conditional construct a) if statement b) switch statement c) while/for d) goto
Why do we use & in c?
What is #line used for?
what is a NULL pointer?
What is 02d in c?
What is a constant and types of constants in c?
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.
c program to manipulate x=1+3+5+...+n using recursion
Why do we need arrays in c?
Eight queens puzzle