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 |
What is a loop?
what are two categories of clint-server application development ?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
How to implement a packet in C
Why use int main instead of void main?
Can we access array using pointer in c language?
Write a program that can show the multiplication table.
What functions are in conio h?
How can I split up a string into whitespace-separated fields?
What is static identifier?
what information does the header files contain?
6 Answers BSNL, Cisco, GDA Technologies,
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?