HTML Tutorial || Networking Assignment || Computer Full Forms || Ms-Office Shortcut Keys || Ms-Office Notes || Number System Notes || Internet Assignment
JavaScript Tutorial || CSS Tutorial || Operating System Notes || History of Computer Assignment || Netwoking Notes || Computer Fundamentals Notes

C Program to Enter Base and Height of a Triangle and Find its Area ?


Q:- Write a C Program to Enter Base and Height of Triangle and Find its Area ?
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
float base,height,area;
clrscr();
printf(“Enter Base of Triangle=”);
scanf(“%f”,&base);
printf(“Enter Height of Triangle=”);
scanf(“%f”,&height);
area=(base*height)/2;
printf(“Area of Triangle=%.2f”,area);
getch();
}


Output

Enter Base of Triangle = 10
Enter Height of Triangle = 15
Area of triangle = 75.00 sq. units

Comments