Home / Programs / C Program to Calculate Area of Scalene Triangle
🚀 Programming Example

C Program to Calculate Area of Scalene Triangle

👁 4,605 Views
💻 Practical Program
📘 Step Learning
C Program to Calculate Area of Scalene Triangle

💻 Program Code

#include"stdio.h"
#include"math.h"
 
int main() {
   int s1, s2, angle;
   float area;
   float M_PI=3.14;
 
   printf("\nEnter Side1 : ");
   scanf("%d", &s1);
 
   printf("\nEnter Side2 : ");
   scanf("%d", &s2);
 
   printf("\nEnter included angle : ");
   scanf("%d", &angle);
 
   area = (s1 * s2 * sin((M_PI / 180) * angle)) / 2;
 
   printf("\nArea of Scalene Triangle : %f \n", area);
   return (0);
}
                        

🖥 Program Output

Enter Side1 : 3

Enter Side2 : 4

Enter included angle : 30

Area of Scalene Triangle : 2.998621
Press any key to continue . . .
                            
📚 Learning Subject

Master Programming Through Practical Examples

Improve your coding logic, problem-solving skills and programming confidence by practicing real-world examples with explanations.

🎯 How to learn from this example

First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.

🔥 Practice suggestion

Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.