Area of triangle

Program:

#include<stdio.h>
int main()
{
float b,h,a;
printf("Enter Base: ");
scanf("%f",&b);
printf("Enter Height: ");
scanf("%f",&h);
a=(b*h)/2;
printf("Area of Triangle: %.2f\n",a);
return 0;

}

Output:



No comments:

Post a Comment

x^y using recursion

Program: #include<stdio.h> int power(int a,int b); int main() { int x,y,ans; printf("Enter x and y:\n "); scanf(...