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
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 |
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 |
Why is c so important?
Write a c program to demonstrate Type casting in c?
Write a program that takes three variables(a,b,c) in as separate parameters and rotates the values stored so that value a goes to b,b,to c and c to a
1 What is a Data Structure?
What is the output of below code? main() { static in a=5; printf("%3d",a--); if(a) main(); }
how to print electricity bill according to following charges first 100 units -1rs per unit for next 200 units-1.50 rs per unit without using conditions
given post order,in order construct the corresponding binary tree
4) Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
struct node {struct node*temp,*new} prinf("%d",sizeof(struct node));
what is Array?
from which concept of 'c', the static member function of 'c++' has came?
What are the types of pointers in c?