Write a function to find the area of a triangle whose
length of three sides is given
Answer Posted / urja pandya
#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 ? | 49 Yes | 30 No |
Post New Answer View All Answers
What are the scope of static variables?
write a program to concatenation the string using switch case?
What is data types?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
What is the condition that is applied with ?: Operator?
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
illustrate the use of address operator and dereferencing operator with the help of a program guys plzzz help for this question
How can variables be characterized?
What is typedef example?
What is scope and lifetime of a variable in c?
How many types of sorting are there in c?
What are the different types of linkage exist in c?
Should a function contain a return statement if it does not return a value?
What does #pragma once mean?
Write a program to check whether a number is prime or not using c?