Wednesday, 1 April 2015

c program to find area and peremeter of a square

 write a c program to find area and peremeter of a square
/*area and peremeter of a square*/
/* author: sai      date:1-4-2015 */

#include<stdio.h>
main()
{
    int s,area,perimeter;
    printf("enter side of a square");
    scanf("%d",&s);
    area = s*s;
    perimeter = 4*s;
    printf("area of the square %d is%d\n",s,area);
    printf("perimeter of the square %d is%d\n",s,perimeter);
}



No comments:

Post a Comment