Tuesday, 25 August 2020

HOW TO FIND AREA OF TRIANGLE USING C PROGRAM?

THE FOLLOWING PROGRAM EXPLAINS ABOUT AREA OF TRIANGLE:

#include<stdio.h>
#include<conio.h>
void main()
float a,b,h //to get accurate results a is area, b is breadth, h is height.
clrscr();
printf("Enter base\n");
scanf("%f",&b);
printf("Enter the height\n");
scanf("%f",&h);
a=0.5*b*h;
printf("Area of triangle=%f",a);
getch();
}

IN OUR NEXT POST I WILL EXPLAIN ABOUT AREA OF SQUARE.

    

No comments:

Post a Comment

C Programming

What is DBMS in brief?

A Database Management System (DBMS) is a software suite designed to efficiently manage, organize, store, manipulate, and retrieve data. It a...