Friday, March 28, 2014

Calculate Area and Perimeter of Rectangle

#include<stdio.h>
#include<stdlib.h>
void line()
{
int i,j;
printf("\n");
for(i=1;i<=42;i++)
printf("=");
}
void header()
{
printf("\n");
printf("Built and Designed by Arslan Malik\n\n www.CworldbyAS.blogspot.com");
printf("\n");
}
int main()
{
line();
header();
line();

int a,b;
printf("Enter Length & Width to calculate Area of Rectangle & Perimeter of Rectangle= \n");
scanf("%d%d",&a,&b);
printf("Area of rectangle is = %d \n\n",a*b);
printf("Perimeter of rectangle is = %d\n\n",2*(a*b));

return 0;
}

No comments:

Post a Comment