Pages

Monday, 8 June 2015

C program to Calculate the Area of a Rectangle

C program to Calculate the Area of a Rectangle

Coding:

#include
int main() {
float l, b, area;
printf("\nEnter the Length of Rectangle : ");
scanf("%f", &l);
printf("\nEnter the Breadth of Rectangle : ");
scanf("%f", &b);
area = l* b;
printf("\nArea of Rectangle : %f", area);
return 0;
}

Output:
Enter the Length of Rectangle : 10.5

Enter the Breadth of Rectangle : 2

Area of Rectangle : 21.000000