Write a function in c to find the area of a triangle whose length of three sides is given.

Answer Posted / jenee

/* Write a function to find the area of a triangle whoes length of three sides is given */

#include<stdio.h>
#include<conio.h>

float triangle(float b,float h)
{
float result;
result=(b*h)/2;
return(result);
}

void main()
{
float a,b,ans;
clrscr();
printf("Enter the Base of Triangle : ");
scanf("%f",&a);
printf("Enter the Height of Triangle : ");
scanf("%f",&b);
ans=triangle(a,b);
printf("Area of Triangle is %f",ans);
getch();
}

Is This Answer Correct ?    11 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why we use conio h in c?

582


write a c program to find the sum of five entered numbers using an array named number

1617


What is the explanation for the dangling pointer in c?

681


What are different types of pointers?

563


what are the advantages of a macro over a function?

647






what is use of malloc and calloc?

1382


What are the __date__ and __time__ preprocessor commands?

573


develop algorithms to add polynomials (i) in one variable

1742


What are different types of operators?

596


What is a ternary operator in c?

652


What does the error message "DGROUP exceeds 64K" mean?

727


Can you please compare array with pointer?

615


Why do we use return in c?

569


What is difference between stdio h and conio h?

888


Explain goto?

718