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
write a c program to find the largest and 2nd largest numbers from the given n numbers without using arrays
What is the explanation for cyclic nature of data types in c?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
What does malloc () calloc () realloc () free () do?
How many levels of pointers can you have?
What is int main () in c?
What is c system32 taskhostw exe?
What does %d do in c?
What does the function toupper() do?
What are the types of macro formats?
i want to know the procedure of qualcomm for getting a job through offcampus
the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
How can I automatically locate a programs configuration files in the same directory as the executable?
What is the total generic pointer type?