A C Program To Find The Area Of An Isosceles Triangle. For More, Head ...

Skip to content Search Gists Search Gists All gists Back to GitHub Sign in Sign up Sign in Sign up Dismiss alert {{ message }}

Instantly share code, notes, and snippets.

@snadahalli snadahalli/isosceles_area.c Created September 26, 2013 17:39 Show Gist options
  • Star (0) You must be signed in to star a gist
  • Fork (0) You must be signed in to fork a gist
  • Embed Select an option
    • Embed Embed this gist in your website.
    • Share Copy sharable link for this gist.
    • Clone via HTTPS Clone using the web URL.

    No results found

    Learn more about clone URLs Clone this repository at <script src="https://gist.github.com/snadahalli/6717753.js"></script>
  • Save snadahalli/6717753 to your computer and use it in GitHub Desktop.
Code Revisions 1 Embed Select an option
  • Embed Embed this gist in your website.
  • Share Copy sharable link for this gist.
  • Clone via HTTPS Clone using the web URL.

No results found

Learn more about clone URLs Clone this repository at <script src="https://gist.github.com/snadahalli/6717753.js"></script> Save snadahalli/6717753 to your computer and use it in GitHub Desktop. Download ZIP A C program to find the area of an isosceles triangle. For more, head to www.c-program-example.com Raw isosceles_area.c This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters Show hidden characters
/***********************************************************
* You can use all the programs on www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact [email protected]
* To find more C programs, do visit www.c-program-example.com
* and browse!
*
* Happy Coding
***********************************************************/
/*
* Cross posted from http://www.c-program-example.com/2011/09/c-program-to-compute-area-of-isosceles.html
*/
/*WAP to compute the area of an isosceles triangle */
#include<stdio.h>
#include<math.h>
int main() {
int a, b, c;
float area, s;
printf("Enter the sides of a triangle:\n");
scanf("%d%d%d", &a, &b, &c);
if ((a + b > c && a + c > b && b + c > a) && (a > 0 && b > 0 && c > 0)) {
if (a == b || b == c || a == c) {
s = (a + b + c) / 2.0;
area = sqrt((s * (s - a) * (s - b) * (s - c)));
printf("\nArea of an isosceles triangle is: %2f\n", area);
} else {
printf("\nTriangle is not an isosceles ");
}
} else {
printf("\n Triangle formation not possible\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment You can’t perform that action at this time.

Tag » Area Of Isosceles Triangle Code In C