Sunday, June 10, 2012

CS 110 COMPUTER PROGRAMMING LAB - Basic C Programs


//Program to calculate Area and Perimeter of Rectangle.


#include<stdio.h>
#include<conio.h>
void main()
{
float l,b,area,per;
clrscr();
printf("\n Enter the length and breadth of the rectangle \n");
scanf("%f%f",&l,&b);
area=l*b;
per=2*(l+b);
printf("\n The area and perimeter of rectangle with l=%.2f and b=%.2f is \n %.2f and %.2f",l,b,area,per);
getch();
}

0 comments:

Post a Comment

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites More