C program to find area of scalene triangle

C program to find area of scalene triangle:
If you are using any software then below program will not give an error, but if you are using TURBO C then you have to make some changes like: void main() and some function like clrscr() or getch().



#include<stdio.h>
#include<math.h>

main()
{
   int s1,s2,angle;
   float area,PI=3.14;

   printf("Enter Side1 : ");
   scanf("%d",&s1);

   printf("\nEnter Side2 : ");
   scanf("%d",&s2);

   printf("\nEnter included angle : ");
   scanf("%d",&angle);

   area=(s1*s2*sin((PI/180)*angle))/2;

   printf("\nArea of Scalene Triangle : %f",sarea);
}

OUTPUT:

Enter Side1 : 5

Enter Side2 : 5

Enter included angle : 70

Area of Scalene Triangle : 11.743507

 

Leave a Reply

Your email address will not be published. Required fields are marked *

15 − 3 =