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 are different storage class specifiers in c?

0 Answers  


what is structuer?

4 Answers   LG Soft, Wipro,


Write a Program to print this triangle: * ** * **** * ****** * ******** * ********** use two nested loops.

12 Answers   MIT, TCS,


EXPLAIN #INCLUDE<STDIO.H> EXPLAIN #INCLUDE<CONIO.H>

4 Answers  


what is ram?

3 Answers   TCS,


#include<stdio.h> int main() { int a[3][3][2]= {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18}; printf("%d\n",*(*(*a+1)); return 0; } What will be the output of the above question? And how?

1 Answers   Groupon,


Method Overloading exist in c ?

3 Answers   Wipro,


write a program for size of a data type without using sizeof() operator?

22 Answers   HCL, IBM,


What are loops c?

0 Answers  


while initialization of array why we use a[][2] why not a[2][]...?

0 Answers   Aptech,


for(i=0;i=printf("Hello");i++); printf("Hello"); how many times how will be printed?????????

8 Answers  


Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.

0 Answers  


Categories