- 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
14 Antworten
+ 2
morgan check your spelling of "equilateral triangle" in your source code
+ 2
Arsenic
Well done!
+ 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.
0
if (side1==side2 && side2==side3 && side3 == side1)
0
No, I already did it like this way but its showing wrong
0
I don't know what you did but i'm getting right output after this.
0
On which perticular input did you got a false output ?
0
I didn't say I am getting wrong output but it says my logic I used in code is wrong according to question
0
morgan
What happens if the dimensions given can't make a triangle?
Is this a factor within the challenge details?
0
morgan
I also note there is \n after Isosceles triangle.
Sometimes this can make a difference
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
0
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;
}
0
I think you should add the constraints. Side1 being from 1 to 1001