If lengths of three sides of a tringle are input through the keyboard write a program to find the area of tringle.

 If lengths of three sides of a triangle are input through the keyboard write a program to find the area of triangle.

//Find the area of triangle  ,given the sides.

#include <stdio.h>

#include<math.h>                //for sqrt()

int main() 

{

float a,b,c,sp, area;

printf("\nEnter sides of a triangle:");

scanf("%f%f%f",&a,&b,&c);

sp =(a+b+c)/2;

area=sqrt(sp*(sp-a)*(sp-b)*(sp-c));

printf("Area of triangle=%f\n",area);

return 0;

}

output--- Enter sides of tringle: 4   5   6

                Area of triangle= 9.921567

 





paper of size A0 has dimensions 1189 mmx 841 mm .Each subsequent size A(n) is defined as A(n-1) cut in half parallel to its shorter sides .Thus paper of size A1 would have dimensions 841 mm X 594 mm .Write a program to calculate the print paper sizes A0,A1,A2,.........A8. 

  https://www.blogger.com/u/2/blog/post/edit/5851128460296589847/8384434084948408766

 

The length and breadth of a rectangle and radius of a circle are input through the keyboard. write a program to calculate the area and perimeter of the rectangle, and the area and circumference of the circle  

https://www.blogger.com/u/2/blog/post/edit/5851128460296589847/7280931487310259817

 


Comments

Popular posts from this blog

the length and breadth of a rectangle and radius of a circle are input through the keyboard. write a program to calculate the area and perimeter of the rectangle, and the area and circumference of the circle

paper of size A0 has dimensions 1189 mmx 841 mm .Each subsequent size A(n) is defined as A(n-1) cut in half parallel to its shorter sides .Thus paper of size A1 would have dimensions 841 mm X 594 mm .Write a program to calculate the print paper sizes A0,A1,A2,.........A8.