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
Why we use conio h in c?
What is the function of this pointer?
c language interview questions & answer
How can I open files mentioned on the command line, and parse option flags?
What is size of union in c?
Explain the use of #pragma exit?
What does calloc stand for?
Explain what is the difference between null and nul?
Write a simple code fragment that will check if a number is positive or negative.
Differentiate between a structure and a union.
What is define c?
What is a double c?
What are logical errors and how does it differ from syntax errors?
a c code by using memory allocation for add ,multiply of sprase matrixes
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software