Monday, April 18, 2022

Write a program that calculates the area of a circle and triangle

Area of a triangle

#include<stdio.h>

int main()

{

      //Area of a triangle = 0.5*base*height     

       float base, height, area;

       printf("Enter the base and height value : ");

       scanf("%f %f", &base, &height);

 

       area = 0.5*base*height;

       printf("Area of Triangle is: %.2f",area);

       return (0);

}

 

No comments:

Post a Comment

 https://www.linkedin.com/pulse/building-real-time-database-monitoring-dashboard-oracle-khaleeq-tpwxf/