Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET
how to find area of a triangle when its three sides are given using dot net
Posted 3-Oct-12 3:30am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

25.9 million results. Wow.... GOOGLE[^] is your friend and you should visit him often. What you need to do is find a link in the list I've provided which gives you the algorithm and then convert that into the code language of your choice. Happy hunting.
  Permalink  
Comments
_Amy at 3-Oct-12 9:44am
   
It is giving even more than that. +5! :)
Marcus Kramer at 3-Oct-12 9:51am
   
Thanks...
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

You should try this:
//Suppose your three sides are a, b & c
private double area(double a, double b, double c){
    double s = (a + b + c) / 2;
    return Math.Sqrt(s * (s - a) * (s - b) * (s - c));
}
 

 
--Amit
  Permalink  
Comments
Marcus Kramer at 3-Oct-12 9:51am
   
Please don't just provide a code solution to someone asking a blatant homework question. What will the OP learn from that. What we want to do is show them how to figure out the answer. By just giving them something to copy/paste they are not learning anything. (I haven't voted on your answer as it is correct)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 305
1 _Amy 235
2 Peter Leow 205
3 Andreas Gieriet 180
4 Abhinav S 140
0 OriginalGriff 7,540
1 Sergey Alexandrovich Kryukov 6,462
2 Maciej Los 3,849
3 Peter Leow 3,653
4 CHill60 2,712


Advertise | Privacy | Mobile
Web01 | 2.8.140721.1 | Last Updated 3 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100