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

‎How to define structures? · ‎

0 Answers  


What is the use of function overloading in C?

0 Answers   Ittiam Systems,


I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.

0 Answers   Oracle,


Write a program to show the workingof auto variable.

2 Answers   Infotech,


why do we use # in c-language?

1 Answers  






Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.

0 Answers  


What does typedef struct mean?

0 Answers  


Explain the difference between malloc() and calloc() in c?

0 Answers  


write a program structure to find average of given number

1 Answers  


how to find greatet of 10 numbers without using array?

4 Answers  


Why do we need functions in c?

0 Answers  


What are the loops in c?

0 Answers  


Categories