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
Why we use conio h in c?
write a c program to find the sum of five entered numbers using an array named number
What is the explanation for the dangling pointer in c?
What are different types of pointers?
what are the advantages of a macro over a function?
what is use of malloc and calloc?
What are the __date__ and __time__ preprocessor commands?
develop algorithms to add polynomials (i) in one variable
What are different types of operators?
What is a ternary operator in c?
What does the error message "DGROUP exceeds 64K" mean?
Can you please compare array with pointer?
Why do we use return in c?
What is difference between stdio h and conio h?
Explain goto?