‘C’ program to calculate area and perimeter of a rectangle.

C File =>


/* Write a ‘C’ program to calculate area and perimeter  of a rectangle. */

#include<stdio.h>
int main() 
{
    int l,b,a,p;
    printf("\n Enter length and bredth of rectangle : ");
    scanf("%d%d",&l,&b);
    a=l*b;
    p=2*(l+b);
    printf("\n Area of rectangle = %d",a);
    printf("\n Perimeter of rerectangle = %d",p);
 return 0;
}

Comments

Popular posts from this blog

Program to accept and display details of 5 students (roll no, name, percentage) using structure

C program to accept names of n cities and search for city named “Pune”.