bsc

Comprehensive codebase and cou...
Log | Files | Refs | Activity | README | LICENSE

root / semester_1 / tuition-c / APC-PRAC-003.c

APC-PRAC-003.c (433B)


      1 /* WAP to accept  diagonal of a square and calculate area, parimeter */
      2 
      3 #include <stdio.h>
      4 #include <math.h>
      5 int main()
      6 {
      7     double dia, side, area, peri;
      8     printf("Enter the diagonal of the square : ");
      9     scanf("%lf", &dia);
     10     side = dia / sqrt(2);
     11     area = pow(side, 2);
     12     peri = 4 * side;
     13     printf("\nArea of the square      : %g"
     14            "\nPerimeter of the square : %g",
     15            area, peri);
     16     return 0;
     17 }
© notamitgamer • Site Built: 2026-09-05 01:53:16 UTC • git-mirror commit: c170d72 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror