Saturday, 16 July 2011

Write a c program to find the area of a right angled triangle




C
program for area of right angled triangle








Formula of
area of right angled triangle:



Area = (1/2) * height * width



C code:



#include



int main(){



    float h,w;

    float area;



    printf("Enter
height and width of the right angled triangle : ");

    scanf("%f%f",&h,&w);



    area
= 0.5 * h * w;



    printf("Area of
right angled triangle is: %.3f",area

No comments:

Post a Comment