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

What is a loop?

0 Answers  


what are two categories of clint-server application development ?

1 Answers  


I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.

0 Answers  


How to implement a packet in C

0 Answers   Aricent,


Why use int main instead of void main?

0 Answers  






Can we access array using pointer in c language?

0 Answers  


Write a program that can show the multiplication table.

0 Answers   Student,


What functions are in conio h?

0 Answers  


How can I split up a string into whitespace-separated fields?

0 Answers  


What is static identifier?

0 Answers   TCS,


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 (<>)?

0 Answers  


Categories