Write a function in c to find the area of a triangle whose length of three sides is given.
Answer Posted / 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 View All Answers
What are the features of c language?
Write a program to print "hello world" without using a semicolon?
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
What is optimization in c?
Explain what does the format %10.2 mean when included in a printf statement?
All technical questions
Explain that why C is procedural?
FILE PROGRAMMING
What is getch() function?
What does == mean in texting?
What are runtime error?
What is define c?
Is c object oriented?
What is wrong in this statement? scanf(“%d”,whatnumber);
Do you know the purpose of 'register' keyword?