HOW TO CALCULATE AREA OF THE TRIANGLE IN C PROGRAM
#include<stdio.h> //header file stdio.h
#include<conio.h> //header file conio.h
main() //main function
{ //start of the program
int b,h ,area; //variable declaration
clrscr();
printf("enter the base and height of the triangle");
scanf("%d%d",&b,&h); //reading values from user
area=b*h/2; //area of the triangle formula
printf("area of the triangle is %d",area);
getch();
} //end of the program
#include<stdio.h> //header file stdio.h
#include<conio.h> //header file conio.h
main() //main function
{ //start of the program
int b,h ,area; //variable declaration
clrscr();
printf("enter the base and height of the triangle");
scanf("%d%d",&b,&h); //reading values from user
area=b*h/2; //area of the triangle formula
printf("area of the triangle is %d",area);
getch();
} //end of the program
No comments:
Post a Comment