Write a function to find the area of a triangle whose
length of three sides is given

Answer Posted / urja pandya

#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 ?    49 Yes 30 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is scanf_s in c?

621


What are the rules for identifiers in c?

579


Is c# a good language?

597


What is binary tree in c?

617


Is it possible to use curly brackets ({}) to enclose single line code in c program?

776






Explain how can I make sure that my program is the only one accessing a file?

611


What is structure and union in c?

584


What are the types of type specifiers?

613


What is difference between far and near pointers?

594


Explain what is the benefit of using #define to declare a constant?

599


Who is the founder of c language?

669


Can a pointer be null?

550


What is an endless loop?

790


What does 4d mean in c?

928


How do I determine whether a character is numeric, alphabetic, and so on?

614