Write a function in c to find the area of a triangle whose length of three sides is given.
Answer Posted / reshma
#include<stdio.h>
#include<conio.h>
float triangle (float b, float h)
{
float result;
result=(b*h)/2;
return(result);
}
void main()
{
clrscr();
float a,b,ans;
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 ? | 14 Yes | 12 No |
Post New Answer View All Answers
How can I find the modification date and time of a file?
What are high level languages like C and FORTRAN also known as?
to find the closest pair
What is an identifier?
Why C language is a procedural language?
What are control structures? What are the different types?
What is a header file?
What is structure in c definition?
What are the different types of pointers used in c language?
Can math operations be performed on a void pointer?
What is the meaning of c in c language?
Explain how can type-insensitive macros be created?
How to establish connection with oracle database software from c language?
How do you print only part of a string?
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0