## C program to calculate area and perimeter of a Rectangle…!!!

In this tutorial we are going to write a program to calculate area and perimeter of a rectangle.Here we are going to use input and output statement for programming.

1.The main input of this program is length and breadth of the rectangle.we are going to take input from the user through scanf() statement.
2.As a processing step we need to calculate the area and perimeter of the rectangle.
3.After calculating the area and perimeter we are going to display the area and perimeter.

Hence from the above points we are going to write the program.

```#include<stdio.h>
#include<conio.h>
void main()
{
float length,breadth,area,perimeter;  //variables to store the values from the users
clrscr();                                               //To clear the output screen
printf("\nEnter the length of the rectangle:");
scanf("%f",&length);
printf("\nEnter the breadth of the rectangle:");
area = length * breadth;                    //Calculating the area using the formula.
perimeter = 2*(length + breadth);    //Calculating the perimeter using the formula.
getch();
}```

OUTPUT:  Very enthusiastic about technology and likes to share my knowledge through blogging. Has Bachelor's in Information Technology and currently pursuing my PhD in Computer Science.
This entry was posted in C and tagged , . Bookmark the permalink.

### 3 Responses to C program to calculate area and perimeter of a Rectangle…!!!

1. sandip deshmukh says:

2. Christiana says:
3. Rahim ullal dard says: