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 is a char c?
Explain the term printf() and scanf() used in c language?
What are the different properties of variable number of arguments?
What is the difference between call by value and call by reference in c?
please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code
Can we declare variable anywhere in c?
What does the function toupper() do?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
Why do we use int main?
write a program to convert a expression in polish notation(postfix) to inline(normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix.
Do you know the use of 'auto' keyword?
Write a code to remove duplicates in a string.
what value is returned to operating system after program execution?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
How can I find out how much free space is available on disk?