C Practice Problems For Beginners-6
Problem Statement:-Write a C program to calculate the area of triangle.
Code:-
#include<stdio.h>
#include<conio.h>
void main()
{
float area, base, height;
printf("Enter base:- ");
scanf("%f", &base);
printf("Enter height:- ");
scanf("%f", &height);
area=0.5*base*height;
printf("Area Of Triangle:- %f", area);
getch();
}
Output:-
0 Comments