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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / 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

More C Interview Questions

Find errors (1) m = ++a*5; (2) a = b ++ -c*2; (3)y = sqrt (1000);

5 Answers  


write a program to sort the elements in a given array in c language

10 Answers   TCS,


What is the difference between single charater constant and string constant?

0 Answers  


how to add numbers without using arithmetic operators.

14 Answers   TCS,


What are categories used for in c?

0 Answers  






Explain how do you determine a file’s attributes?

0 Answers  


Write a program to reverse a given number in c language?

0 Answers  


What is meant by type casting?

0 Answers  


Where can I get an ansi-compatible lint?

0 Answers  


What is struct node in c?

0 Answers  


WAP to accept first name,middle name & last name of a student display its initials?

5 Answers   AITH, NIIT,


How can my program discover the complete pathname to the executable from which it was invoked?

0 Answers  


Categories