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 |
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
In a header file whether functions are declared or defined?
How to print "I Love My India" without using semi colon?
Explain how can you tell whether a program was compiled using c versus c++?
What does the file stdio.h contain?
Is exit(status) truly equivalent to returning the same status from main?
how can f be used for both float and double arguments in printf? Are not they different types?
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
write a program to swap two numbers without using temporary variable?
What is the auto keyword good for?
What are file streams?
find the sum of two matrices and WAP for it.