PPS Practical 2

PPS Practical 2
  • Aim: Write a program to find area of triangle(a=h*b*.5). a = area, h = height, b = base.
  • Code:
    //For turboc++ remove below comments
    #include <stdio.h>
    //#include<conio.h>
    void main()
    {
    	float height,base,area;
        //clrscr();
    	printf("enter Height of Triangle : ");
    	scanf("%f",&height);
    	printf("enter Base of Triangle : ");
    	scanf("%f",&base);
    	area=height*base*0.5;
    	printf("Area of a Triangle is : %.2f",area);
        //getch();
    }
                    
  • Output:
  • Output of practical2

Comments