Area and Perimeter of Square in C

Area and Perimeter of Square | Program to find Perimeter of Square in C | C Assignments


#include
#include
void main()
{
float s,a,p;
clrscr();
printf(“enter the s value:\n”);
scanf(“%f”,&s);
a=s*s;
p=4*s;
printf(“area=%f\n perimeter=%f\n”,a,p);
getch();
}






Output:
enter the s value:
5
area=25.000000
perimeter=20.000000

No comments:

Post a Comment