# C Program To Calculate Perimeter, Diagonal of a Square using its Side

http://technotip.com/7083/c-program-to-calculate-perimeter-diagonal-of-a-square-using-its-side/ Lets write a C program to calculate area, perimeter and diagonal of a square by using length of its side. We ask the user to input the length of its side. Formula To Calculate Area, Perimeter and Diagonal of…

http://technotip.com/7083/c-program-to-calculate-perimeter-diagonal-of-a-square-using-its-side/

Lets write a C program to calculate area, perimeter and diagonal of a square by using length of its side. We ask the user to input the length of its side.

Formula To Calculate Area, Perimeter and Diagonal of a Square using its side

diagonal = sqrt(2) x side;

area = ( diagonal x diagonal ) / 2.0

OR

area = ( diagonal x diagonal ) * 0.5

OR

area = side x side;

Perimeter = 4 x side;

Expected Output for the Input

User Input:

Enter length of side of the Square

10.5

Output:

Area of the Square is 110.250000

Perimeter of the Square is 42.000000

Diagonal of the Square is 14.849242

Note: All the sides of a square are equal. Both the diagonals of the square are of equal length.

C Programming Interview / Viva Q&A List

http://technotip.com/6378/c-programming-interview-viva-qa-list/

C Programming: Beginner To Advance To Expert

http://technotip.com/6086/c-programming-beginner-to-advance-to-expert/