Search & Find out

Thursday, November 26, 2009

Find areas

 

To find area of circle, square, rectangle, trangle


#include "stdio.h"
#include "conio.h"



void main()
{
float area_circle;
float r;
float pi=3.14;
float area_square;
float s;
float area_rectangle;
float l,b;
float area_triangle;
float h,b1;
clrscr();
    printf("\n Enter radius:\n");
    scanf("%f",&r);
    area_circle=pi*r*r;
    printf("area of circle:\t%f",area_circle);
    printf("\n\n Enter side:\n");
    scanf("%f",&s);
    area_square=s*s;
    printf("area of square:\t%f",area_square);
    printf("\n\n Enter length and breadth:\n");
    scanf("%f%f",&l,&b);
    area_rectangle=l*b;
    printf("area of rectangle:\t%f",area_rectangle);
    printf("\n\n Enter height and base:\n");
    scanf("%f%f",&h,&b1);
    area_triangle=0.5*b1*h;
    printf("area of triangle:\t%f",area_triangle);
    getch();
}



Download the executable (.exe)  file for this program..
download

0 comments:

Post a Comment

 

My Blog List

Term of Use