To find out area and perimeter of a Square and a Rectangle using C programming
just copy the bellow code and paste it to your TurboC software. And then run the program.
just copy the bellow code and paste it to your TurboC software. And then run the program.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,l,b;
clrscr();
printf("Enter the side of the Square : ");
scanf("%d",&a);
printf("\n The area of the Square : %d",a*a);
printf("\n The perimeter of the Square : %d",4*a);
printf("\n\n Enter the length and breadth of the Rectangle : ");
scanf("%d \n %d",&l,&b);
printf("\n\n Area of the Rectangle : %d",l*b);
printf("\n Perimeter of the Rectangle : %d",2*(l+b));
getch();
}
0 comments:
Post a Comment