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
Why do we use stdio h and conio h?
Are the variables argc and argv are local to main?
What the different types of arrays in c?
Can main () be called recursively?
Why is c so important?
Define recursion in c.
How can you restore a redirected standard stream?
What is a static function in c?
What are the different types of data structures in c?
What are the salient features of c languages?
hi send me sample aptitude papers of cts?
What kind of structure is a house?
What is the equivalent code of the following statement in WHILE LOOP format?
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);