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


Please Help Members By Posting Answers For Below Questions

Explain what is the difference between the expression '++a' and 'a++'?

620


When is a “switch” statement preferable over an “if” statement?

639


Is linux written in c?

594


How do you convert strings to numbers in C?

703


What is difference between array and structure in c?

570






What extern c means?

527


How are 16- and 32-bit numbers stored?

717


Why do we use & in c?

580


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.

1757


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

593


Wt are the Buses in C Language

2744


Why enum is used in c?

515


Can the “if” function be used in comparing strings?

580


What is operator precedence?

637


What is LINKED LIST? How can you access the last element in a linked list?

627