C Program to Find Area of an Isosceles Triangle

C Program to Find Area of an Isosceles Triangle

C program to find area of an isosceles triangle; Through this tutorial, we will learn how to find or calculate area of an isosceles triangle in c program.

Programs to Find Area of an Isosceles Triangle in C

  • C Program to Find Area of an Isosceles Triangle Using Formula
  • C Program to Find Area of an Isosceles Triangle using Function

C Program to Find Area of an Isosceles Triangle Using Formula

#include <stdio.h>
#include <math.h>

int main()
{
    float a, b, IsoArea;
    
    // Enter the Same Sides length
    printf("Enter Isosceles Triangle Length of a Side = ");
    scanf("%f",&a);

    printf("Enter Isosceles Triangle Other Side = ");
    scanf("%f",&b);

    IsoArea = (b * sqrt((4 * a * a) - (b * b)))/4;

    printf("The Area of the Isosceles Triangle = %.3f\n", IsoArea);
    
    return 0;
}

The Output of the above c program; as follows:

Enter Isosceles Triangle Length of a Side = 8
Enter Isosceles Triangle Other Side = 10
The Area of the Isosceles Triangle = 31.225

C Program to Find Area of an Isosceles Triangle using Function

#include <stdio.h>
#include <math.h>

float IsoscelesArea(float a, float b)
{
    return (b * sqrt((4 * a * a) - (b * b)))/4;
}
int main()
{
    float a, b, IsoArea;
    
    printf("Enter Isosceles Triangle Length of a Side = ");
    scanf("%f",&a);

    printf("Enter Isosceles Triangle Other Side = ");
    scanf("%f",&b);

    IsoArea = IsoscelesArea(a, b);

    printf("The Area of the Isosceles Triangle = %.3f\n", IsoArea); 
    
    return 0;
}

The Output of the above c program; as follows:

Enter Isosceles Triangle Length of a Side = 12
Enter Isosceles Triangle Other Side = 10
The Area of the Isosceles Triangle = 54.544

Recommended C Programs

AuthorAdmin

My name is Devendra Dode. I am a full-stack developer, entrepreneur, and owner of Tutsmake.com. I like writing tutorials and tips that can help other developers. I share tutorials of PHP, Python, Javascript, JQuery, Laravel, Livewire, Codeigniter, Node JS, Express JS, Vue JS, Angular JS, React Js, MySQL, MongoDB, REST APIs, Windows, Xampp, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL and Bootstrap from a starting stage. As well as demo example.

Leave a Reply

Your email address will not be published. Required fields are marked *