-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathP15.c
42 lines (40 loc) · 751 Bytes
/
P15.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Author :- Rajeshwari
purpose :- solving problem
Date :-07/10/21 Tuesday .
Date of modification :- 20/12/21 , monday .
Problem statement
write a program to accept 3 sides of a triangle and print whether it is an equilateral triangle
using multiple if
*/
#include<stdio.h>
void main()
{
int s1,s2,s3,eq_count=0,s;
printf("Enter sides of triangle");
scanf("%d%d%d",&s1,&s2,&s3);
s=s1+s2+s3;
if(s==180)
{
if(s1==s2)
{
eq_count++;
}
if(s3==s2)
{
eq_count++;
}
if(eq_count==2)
{
printf("It is equilateral");
}
if(eq_count!=2)
{
printf("Is is not a equilateral");
}
}
else
{
printf("Is is not a triangle");
}
}