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

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including 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. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

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