Write a function to find the area of a triangle whose
length of three sides is given
Answer Posted / urja pandya
#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 ? | 49 Yes | 30 No |
Post New Answer View All Answers
What is assert and when would I use it?
What is #include stdio h and #include conio h?
Why are algorithms important in c program?
What does a function declared as pascal do differently?
Lists the benefits of c programming language?
What are the three constants used in c?
What are register variables? What are the advantage of using register variables?
What are the different types of C instructions?
What is the use of sizeof () in c?
What is the difference between struct and typedef struct in c?
How can I convert a number to a string?
find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }
write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.
What is function definition in c?
What functions are used in dynamic memory allocation in c?