P014.c (534B)
1 /* 2 * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025 3 * Repo: https://github.com/notamitgamer/bsc 4 * License: MIT 5 */ 6 7 /* WAP to accept the diagonal of 8 square. Find and display the area and 9 perimeter of the square. */ 10 11 #include<stdio.h> 12 #include<math.h> 13 int main() { 14 double d, side, area, per; 15 printf("Enter the diagonal : "); 16 scanf("%lf", &d); 17 side = d / sqrt (2); 18 area = side * side; 19 per = 4 * side; 20 printf("\nArea of the Square : %lf" 21 "\nPerimeter of the Square : %lf", area, per); 22 return 0; 23 }