Area of the Triangle || Heron's formula || Functions in C || Arguments but No Return value || C Programming
In this, we are going to see the Functions that have arguments but 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 a, float b, float c)
{
    float s, area;
    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");
    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);
    opt(a, b, c);

    return 0;
}
//.......Coded by YASH ALLAPURIA


#ENJOY CODING

Post a Comment

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

Previous Post Next Post