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
Explain what is the difference between the expression '++a' and 'a++'?
When is a “switch” statement preferable over an “if” statement?
Is linux written in c?
How do you convert strings to numbers in C?
What is difference between array and structure in c?
What extern c means?
How are 16- and 32-bit numbers stored?
Why do we use & in c?
Sir,please help me out with the code of this question. Write an interactive C program that will encode or decode multiple lines of text. Store the encoded text within a data file, so that it can be retrieved and decoded at any time. The program should include the following features: (a) Enter text from the keyboard, encode the text and store the encoded text in a data file. (b) Retrieve the encoded text and display it in its encoded form. (c) Retrieve the encoded text, decode it and then display the decoded text. (d) End the computation. Test the program using several lines of text of your choice.
Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?
Wt are the Buses in C Language
Why enum is used in c?
Can the “if” function be used in comparing strings?
What is operator precedence?
What is LINKED LIST? How can you access the last element in a linked list?