program to find an area of rectangle and perimeter of a rectangle

program to find an area of rectangle and perimeter of a rectangle


Hello friends today we are going to find an area of a rectangle and perimeter of a rectangle 
And this program we will take the input from the user to find the the result of perimeter and rectangle area.
A simple program for simple programmer is a first step towards learning the complex quotes first you have to use the maths formula here so that in next quotes you don't face any problem of how to apply the course of maths fear quotes mean the formula youyou have used in use in the program for the calculation

But going for the code you must have the basic knowledge like what is a rectangle how to find its perimeter how to find its area if you know all these things then the next Steps From of making a formula for it just you have to build a formula and then follow the algorithm step by step to calculate it I know its a simple program but many a times the formula is implemented wrongly so to avoid this make a rough program first and then implemented



What is a rectangle?


the rectangle is a quadrilateral having four sides, all interior angle is 90.
the area is the amount of 2 D space inside the boundary of the rectangle.

to calculate the area of a rectangle we need length and width of a rectangle. first, take the input from the user and use the formula as
 area of rectangle
area =L*B
and perimieter

perimeter =2*(L+B)

#include<stdio.h>
#include<conio.h>
void main()
{
int l,b,ar,pr;
clrscr();
printf("enter length and width \n);
scanf("%d%d",&l,&b);
ar=l*b;
pr=2*(l+b);
printf("area =%d\tperimeter=%d",ar,pr);
getch();
}

output
entrer length and width
2 3
area=6 perimeter=10



some property of a rectangle
#opposite side of the rectangle is equal and parallel
#special case of a trapezium.
#special case of parallelogram


Hope you have made the program with the source code and find the output this program you made was functioning as you have expected comment your views and the result you have obtained by making different inputs change the scored little bit change the appearance of the program and share rate among your friends in the comment section


Share this blog among your friends and help them to find the area of a rectangle and the perimeter of a rectangle by giving them the source code as small programs have time to build their confidence of programming.


C for fun is based on the sharing is caring consept so when you share this blog with your friends they share with others and just make Sharing keep sharing

Keep coding
Keep learning
And keep updating yourself about the new concepts and keep devising the programming language as programming is all game of practice if you do not do so then you are out of the race.....




No comments

thanks for reading and sharing.I hope it would help you!!!!

Powered by Blogger.