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
What are the advantages of using linked list for tree construction?
What is variable initialization and why is it important?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
What are reserved words with a programming language?
What is sizeof array?
What is the benefit of using const for declaring constants?
Why does the call char scanf work?
Why is extern used in c?
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
How do you list files in a directory?
Why is it usually a bad idea to use gets()? Suggest a workaround.
How can you draw circles in C?
The number of measuring units from an arbitarary starting point in a record,area,or control block to some other point a) recording pointer b) offset c) branching d) none
What is the purpose of realloc()?
Explain the bubble sort algorithm.