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


Please Help Members By Posting Answers For Below Questions

How can I find the modification date and time of a file?

608


What are high level languages like C and FORTRAN also known as?

691


to find the closest pair

1827


What is an identifier?

632


Why C language is a procedural language?

625






What are control structures? What are the different types?

604


What is a header file?

640


What is structure in c definition?

579


What are the different types of pointers used in c language?

616


Can math operations be performed on a void pointer?

593


What is the meaning of c in c language?

602


Explain how can type-insensitive macros be created?

577


How to establish connection with oracle database software from c language?

1681


How do you print only part of a string?

620


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1456