ProAnswers.org

Write a C program to find out the Area and Perimeter of Rectangle

#include

#include 

void main() 

{ 

float a,b,l,p; 

clrscr(); 

printf(“enter the l and b value:

”);

scanf(“%f%f”,&l,&b); 

a=l*b; 

p=2*(l+b); 

printf(“area=%f

perimeter=%f
”,a,p);

getch(); 

} 

Output: 

enter the l and b value: 

6 

8 

area=48.000000 

perimeter=28.000000