Program
#include<stdio.h> int main() { int s,a,p; printf("**************************************************"); printf("\n**************************************************"); printf("\n** WAP to find area and perimeter of a square **"); printf("\n** Created by Sheetal Garg **"); printf("\n** Assistant Professor **"); printf("\n** Phone No:9467863365 **"); printf("\n**************************************************"); printf("\n**************************************************"); printf("\nenter the side of square \n "); scanf("%d",&s); a = s*s; printf("the area of square is %d \n",a); p = 4*s; printf("the perimeter of rectangle is %d",p); return 0; }
Output
************************************************** ************************************************** ** WAP to find area and perimeter of a square ** ** Created by Sheetal Garg ** ** Assistant Professor ** ** Phone No:9467863365 ** ************************************************** ************************************************** enter the side of square 5 the area of square is 25 the perimeter of rectangle is 20