Area of the Triangle || Heron's formula || Functions in C || No Arguments and No Return value || C Programming
In this, we are going to see the Functions that have no arguments and no return value, this program we are going to find area of the triangle using heron's formula in C Programming Language.

 



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

float opt()
{
    float s, area;
    float a, b, c;
    printf("Enter the sides of the triangle: \n");
    printf("a = ");
    scanf("%f", &a);
    printf("b = ");
    scanf("%f", &b);
    printf("c = ");
    scanf("%f", &c);
    s = ((a + b + c) / 2);
    area = sqrt(s * (s - a) * (s - b) * (s - c));
    printf("Area of the triangle is:  %f", area);
}

float main()
{
    system("cls");
    opt();
    return 0;
}
//.......Coded by JAIDEEP JAMBLE


#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post