- 3

I dont get where I was wrong

Functional Description : If All the Sides are Equal then it is a Equilateral Triangle If two Sides are Equal then it is an Isosceles Triangle If no Sides are Equal then it is a Scalene TriangleConstraints:1<=side1<=1001<=side2<=1001<=side3<=100Input Format:Only line of integer has three values of type integer separated by a space representing 'side1','side2' and 'side3'.Output Format: Print as either equilateral or scalene or isosceles triangle based on the values of the sides. https://code.sololearn.com/cGAv70K5VYum

2nd Dec 2021, 7:47 AM
morgan
morgan - avatar
14 ответов
+ 2
morgan check your spelling of "equilateral triangle" in your source code
2nd Dec 2021, 12:34 PM
Arsenic
Arsenic - avatar
+ 2
Arsenic Well done!
2nd Dec 2021, 12:40 PM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
May I have a look at the question ? In case of an online judge, it can also be a case where you might be giving extra or less output than required.
2nd Dec 2021, 12:01 PM
Arsenic
Arsenic - avatar
0
if (side1==side2 && side2==side3 && side3 == side1)
2nd Dec 2021, 7:52 AM
zexu knub
zexu knub - avatar
0
No, I already did it like this way but its showing wrong
2nd Dec 2021, 7:56 AM
morgan
morgan - avatar
0
I don't know what you did but i'm getting right output after this.
2nd Dec 2021, 8:00 AM
zexu knub
zexu knub - avatar
0
On which perticular input did you got a false output ?
2nd Dec 2021, 8:04 AM
Arsenic
Arsenic - avatar
0
I didn't say I am getting wrong output but it says my logic I used in code is wrong according to question
2nd Dec 2021, 8:07 AM
morgan
morgan - avatar
0
morgan What happens if the dimensions given can't make a triangle? Is this a factor within the challenge details?
2nd Dec 2021, 9:38 AM
Rik Wittkopp
Rik Wittkopp - avatar
0
morgan I also note there is \n after Isosceles triangle. Sometimes this can make a difference
2nd Dec 2021, 9:40 AM
Rik Wittkopp
Rik Wittkopp - avatar
0
Problem Description:Simon was working in a Casa Grande. His superior officer ordered him to construct a new building by incorporating equilateral, scalene and isosceles triangular shapes wherever possible. But he has no idea about equilateral, scalene and isosceles triangle. Can you clarify his doubt by giving him the correct category of triangle based on the values of sides given by simon?Functional Description : If All the Sides are Equal then it is a Equilateral Triangle If two Sides are Equal then it is a Isosceles Triangle If no Sides are Equal then it is a Scalene TriangleConstraints:1<=side1<=1001<=side2<=1001<=side3<=100Input Format:Only line of integer has three values of type integer separated by a space representing 'side1','side2' and 'side3'. Output Format: Print as either equilateral or scalene or isosceles triangle based on the values of the sides. this is the complete question
2nd Dec 2021, 12:07 PM
morgan
morgan - avatar
0
2nd Dec 2021, 12:07 PM
morgan
morgan - avatar
0
#include <stdio.h> int main() { int side1,side2,side3; printf ("Enter three value : "); scanf("%d %d %d",&side1,&side2,&side3); if (side1==side2 && side2==side3) { printf("Equilaterial triangle"); } else if (side1==side3 || side2==side1 || side2==side3) { printf("Isosceles triangle\n"); } else { printf("Scalene triangle"); } return 0; }
3rd Dec 2021, 4:42 AM
Hrithik Vishwakarma
Hrithik Vishwakarma - avatar
0
I think you should add the constraints. Side1 being from 1 to 1001
3rd Dec 2021, 9:22 AM
O Nathan
O Nathan - avatar