C program to find the area and perimeter of a rectangle for SEE and NEB
#include<stdio.h>
#include<conio.h>
main()
{
//calculate the area and perimeter of rectangle
int l,b,a,p;
printf("Enter length and breadth\n");
scanf("%d%d",&l,&b);
a=l*b;
p=2*(l+b);
printf("Area=%d\nPerimeter=%d",a,p);
getch();
}
Output:
No comments:
Post a Comment