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
What is this infamous null pointer, anyway?
What is wrong with this initialization?
Explain about the constants which help in debugging?
What is a structure member in c?
What is I ++ in c programming?
What is a null string in c?
How can you be sure that a program follows the ANSI C standard?
What is the difference between pure virtual function and virtual function?
What is a pointer on a pointer in c programming language?
If I have a char * variable pointing to the name of a function ..
how many types of operators are include in c language a) 4 b) 6 c) 8 d) 12
What is the benefit of using an enum rather than a #define constant?
in linking some of os executables are linking name some of them
Which type of language is c?
What is the use of header?