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 for Addition of Two Numbers
  • C Program to Implement RADIX SORT
  • C Program to Swap Two Numbers without using Third Variable
  • FCFS CPU Scheduling Algorithm Simulation Using C
  • C Program to Implement Doubly Linked List Operations
  • C Program to Implement Structure with Functions
  • C Program to Implement Structure with Pointers
  • C Program to CONCATENATE Two Strings using strcat()
  • C Program for Call By Reference
  • C Program to Find Factorial of a Number using Functions
  • C Program to convert Celsius to Fahrenheit
  • C Program to Find an Element Using Linear Search
  • C Program to Search an Array Element using BINARY SEARCH
  • Bit Stuffing Program in C
  • C Program to Find Sum of Even Integers
  • Privacy Policy
  • Cookie Policy
© programming9.com 2026
Back to top