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 Design Lexical Analyzer
  • C Program for Quick Sort
  • C Program to Calculate NCR
  • C Program to Find Given Number is Armstrong or Not
  • Bubble Sort in C
  • C Program to Implement CONTINUE statement
  • C Program to Evaluate POSTFIX Expression Using Stack
  • C Program to Implement Structure with Pointers
  • C program to Implement BREAK Statement
  • C Program to Print ASCII values of Characters
  • C Program to Calculate Sum of Even Values in an Array
  • C Program for Swapping of Two Numbers Without Using Third Variable
  • C Program to Convert Infix to Postfix Expression using Stack
  • C Program to Implement SJF CPU Scheduling Algorithm
  • C Program to Find Second Largest Number in an Array
  • Privacy Policy
  • Cookie Policy
© programming9.com 2025
Back to top