Wednesday, 1 April 2015

c program to find area and perimeter of a rectangle

write a c program to find area and perimeter of a rectangle
/* To find area and perimeter of a rectangle*/
/* author: sai      date:1-4-2015 */

#include <stdio.h>
main()
{
   int l,b,area,perimeter;
   printf("enter l,b value");
   scanf("%d%d", &l,&b);
   area = l*b;
   printf("%d area of rectangle is\n", area);
   perimeter = 2 * (l + b);
   printf("%d perimeter of rectangle is\n", perimeter);
}




No comments:

Post a Comment