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 |
Do array subscripts always start with zero?
count = 0; for (i = 1;i < = 10; i++);count = count + i; Value of count after execution of the above statements will be a) 0 b) 11 c) 55 d) array
What is the value of a[3] if integer a[] = {5,4,3,2,1}?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
What are the types of operators in c?
How is a structure member accessed?
int x=sizeof(!5.856); What will value of variable x?
write a reverse string to print a stars.(with out using logic) ***** **** *** ** *
f=(x>y)?x:y a) f points to max of x and y b) f points to min of x and y c)error
"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks
How can I trap or ignore keyboard interrupts like control-c?
How would you find a cycle in a linked list?