Write a function to find the area of a triangle whose
length of three sides is given
Answer Posted / urja pandya
#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 ? | 49 Yes | 30 No |
Post New Answer View All Answers
What is scanf_s in c?
What are the rules for identifiers in c?
Is c# a good language?
What is binary tree in c?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
Explain how can I make sure that my program is the only one accessing a file?
What is structure and union in c?
What are the types of type specifiers?
What is difference between far and near pointers?
Explain what is the benefit of using #define to declare a constant?
Who is the founder of c language?
Can a pointer be null?
What is an endless loop?
What does 4d mean in c?
How do I determine whether a character is numeric, alphabetic, and so on?