Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Given three sides of a triangle. Write the Program to
determine whether the triangle is :
1) Invalid
2) Right Angled
3) Isoscales
4) Equilateral
5) Not Special

An Isoscales right angled triangle should be taken as a
Right Angled Triangle

Answer Posted / ganesh bhat

I believe, this is more efficient one. solves all the cases.. comments please. Written in java

public static Map validateTriange(int a,int b,int c)
{
Map props = new HashMap();
boolean isValidTriangle;

int bigSide = a;
if(bigSide<b){bigSide = b;}
if(bigSide<c){bigSide = c;}

boolean isSpecial = false;

if((a+b+c-bigSide)>bigSide)
{
props.put("VALID","YES");
}
else
{
props.put("VALID","NO");
return props;
}

if(a == b||b==c||c == a)
{
props.put("ISOSCELES","YES");
isSpecial = true;
}

if(a == b && b == c)
{
props.put("EQUALATERAL","YES");
isSpecial = true;
}


if(((a*a+b*b+c*c)-bigSide*bigSide) == bigSide*bigSide)
{
props.put("RIGHT_ANGLED","YES");
isSpecial = true;
}

return props;
}

Is This Answer Correct ?    22 Yes 22 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

along with oracle which language will be beneficial to have knowledge with,java,.net,since i m doing oracle have appeared for 8th sem BEIT,plz suggest

1910


5. How do you round the addition or subtraction of two numbers in assembler?

2210


what is programmable BIST in today ic design

2131


write the a cl program with the following specification A. Accept 2 parameters-date and date type B. if date type is J then convert date to *MDY format C. if date type is M convert date to *JUL format 4.send a program message with the value of converted date Please explain for each with coding?

2612


how to check single or double byte in struts

1972


what is the BAM? where we can use it in BizTalk server?

1796


i want to insert textbox value to sql db. i have only one text box but store four values. ple give any one give sample code in asp.net c#..

3601


Write a program to show polymorphism.

1110


Describe the difference between Interface-oriented, Object-oriented and Aspect-oriented programming

11929


Q2. A memory location has physical address D5687h. Compute: a. The offset address if the segment number is D445h. b. The segment number if the offset address is B577h.

2091


In OB52 , How to define two open posting period, Like only 5 and 8 posting should be open.. should not open 6 and 7..period..

1448


Hai, My name is nisha.I have NIC exam.If anybody Knows NIC previous paper pattern pls send me to nishanairp@gmail.com

2164


hi, all this is shoba m.c.a . i have learned abap but no oppurtunities right now as fresher , right now i want to learn any course on demand any one pls suggest me good course and institute in hyderabad

1794


diffrence between oracle apps , .NET , SAP

2098


When will you use shell script/Perl ahead of C/C++?

1072