programming9
  • Flowcharts
  • Programs
      • Back
      • C Programs
      • C++ Programs
      • Java Programs
      • Python Codes
      • HTML Codes
      • Java Script Codes
      • SQL Codes
  • Tutorials
      • Back
      • Java Tutorials
      • Competitive Programming
      • Python Tutorials
      • C Programming
  • Blog
  • Login

C Program to Find Area of a Triangle

Details
Written by: RajaSekhar
Category: C Programs
  • basic c programs
  • C Program
  • area
  • triangle
#include<math.h>
#include<conio.h>
#include<stdio.h>
void main()
{
    float a,b,c,s,area;
    clrscr();
    printf("enter the values of a,b,c");
    scanf("%f %f %f",&a,&b,&c);
    s=(a+b+c)/2;
    area=sqrt(s*(s-a)*(s-b)*(s-c));
    printf("the area of a trangle is : %f ",area);
    getch();
}

 OUTPUT:

enter the values of a,b,c 12
36
45
the area of a trangle is : 158.955765
Possible Error: 1) Function ‘sqrt( )’ should have a prototype : You should include ‘math.h’ Header file, And can use ‘sqrt ( )’ and all other mathematical functions.
Previous article: C Program to Swap Two Numbers without using Third Variable Prev Next article: Evaluate Algebraic Expression (ax+b)/(ax-b) Next
  • C Program to Calculate Sum of Even Values in an Array
  • C Program for Matrix Multiplication
  • C program to Print Triangle Pattern
  • C Program for Arithmetic Operations using Switch Statement
  • Bit Stuffing Program in C
  • C Program for Floyd Triangle
  • C Program to Print Pascal Traingle
  • C Program to Perform Arithmetic Operations Using Switch
  • C Program for Finding Factorial of a Number
  • C Program to Find Simple Interest
  • C Program to Sort List of Strings
  • Find Two's Complement of a Binary Number Using C programming
  • C Program to Find Nth Fibonacci Number Using Recursion
  • C Program to Solve Tower of Hanoi Problem Using Recursive and Non-Recursive
  • C Program to find Size of Integer
  • Privacy Policy
  • Cookie Policy
© programming9.com 2025
Back to top