Code Scrappers


Area of right angled triangle C program


              #include<stdio.h>
              #include<stdlib.h>

              void main()
              {
                  int b, h;

                  float a;

                  printf("\nEnter the base and height : ");

                  scanf("%d%d", &b,&h);

                  a = 0.5 * b * h;

                  printf("\nArea of Right Angle Triangle : %f", a);
              }
          



Output

   Enter the base and height :
   2
   4

    Area of Right Angle Triangle : 4.000000