Find Area of a Square Program

By | June 16, 2019

This is a simple and basic C program. It is about Find  Area of a Square Program.  It calculates and displays area of a square. The user will input only length of one side. Since both sides are equal in a square.

The area of a square can be calculated by the formula as follows:
area = width × height
But we know that the width and height of a square are same. Therefor, the formula becomes:
Area = s 2
where s is the length of one side of a square.

find the area of a square C program

find the area of a square C program

Source Code for “compute the area of a square”  C Language Program

/*
C Program to
find the area of a square
*/

#include<stdio.h>

int main()
{
float area, sideLength;
printf(“Enter length of side of square:”);
scanf(“%f”, &sideLength);
area = sideLength * sideLength;
printf(“Area of Square =%f”, area);
return 0;
}

 679 total views,  4 views today

Leave a Reply

Your email address will not be published. Required fields are marked *