Could you please help why my program goes through do while loop just once, although the condition is true.
//Program is getting numbers from user and realize whether they are correct numbers for triangle side or not and if tey find out the area//

#include<stdio.h>
#include<math.h>
double TraingleArea();
int main(void)
{
int Firstside,Secondside,Thirdside;
char Answer;
do
{
printf("Enter your Triangle's side \n"); 
scanf("%d %d %d", &Firstside, &Secondside, &Thirdside);
if(Firstside<=0 || Secondside<=0 || Thirdside<=0)
printf("Sides of traingle are positive,please enter three positive integer numbers.");
else
{
if(Firstside+Secondside<=Thirdside || Secondside+Thirdside<=Firstside ||Firstside+Thirdside<=Secondside)
printf("They are not valid numbers for sides of traingle.");
else
{
if(Firstside==Secondside && Secondside==Thirdside)

printf("The tringle is Equilateral\t Its area is equal to %f \n",TraingleArea(Firstside,Secondside,Thirdside) );

else if(Firstside==Secondside || Firstside==Thirdside || Secondside==Thirdside)

printf("The triangle is Isosceles\t Its area is equal to %f \n",TraingleArea(Firstside,Secondside,Thirdside) );

else 
printf("The triangle is Scalene\t Its area is equal to %f \n",TraingleArea(Firstside,Secondside,Thirdside) );
}

}
printf("Would you like to continue? Y/N\n");
scanf("%c",&Answer);
}while(Answer=='Y'); 

}

double TraingleArea(unsigned Firstside,unsigned Secondside, unsigned Thirdside)
{
double halfPerimeter=(double)(Firstside+Secondside+Thirds ide)/2;
double Area;
Area=sqrt(halfPerimeter*(halfPerimeter-Firstside)*(halfPerimeter-Secondside)*(halfPerimeter-Thirdside));
return Area;
}

Edited 5 Years Ago by Ezzaral: Fixed code tags.

Please don't immediately cross post your question on multiple boards.

This has already been answered "over there". :(

where has this question been answered ?
What is the name of topic ?

This article has been dead for over six months. Start a new discussion instead.