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
Describe explain how arrays can be passed to a user defined function
What are loops c?
difference between native and cross compilers
Is fortran still used in 2018?
Explain built-in function?
Why do we use & in c?
which of the following is not a character constant a) 'thank you' b) 'enter values of p, n ,r' c) '23.56E-o3' d) all of the above
write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1
How can I call fortran?
What's the right way to use errno?
What are the benefits of c language?
What's a good way to check for "close enough" floating-point equality?
What is bubble sort technique in c?
What is a newline escape sequence?
What is the use of getch ()?