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
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 |
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 |
Find errors (1) m = ++a*5; (2) a = b ++ -c*2; (3)y = sqrt (1000);
write a program to sort the elements in a given array in c language
What is the difference between single charater constant and string constant?
how to add numbers without using arithmetic operators.
What are categories used for in c?
Explain how do you determine a file’s attributes?
Write a program to reverse a given number in c language?
What is meant by type casting?
Where can I get an ansi-compatible lint?
What is struct node in c?
WAP to accept first name,middle name & last name of a student display its initials?
How can my program discover the complete pathname to the executable from which it was invoked?