bsc

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

root / semester_1 / tuition-c / P021.c

P021.c (530B)


      1 /* WAP to input a positive number and check if it is a perfect
      2 square number or not. */
      3 // This code has not been compiled. 
      4 // If you find any issues, please create a new issue on GitHub regarding them.
      5 
      6 #include <stdio.h>
      7 #include <math.h>
      8 int main()
      9 {
     10     int n, temp;
     11     double sr;
     12     printf("Enter the number : ");
     13     scanf("%d", &n);
     14     sr = sqrt(n);
     15     temp = (int)sr;
     16     if (temp * temp == n)
     17         printf("\nThis is a perfect square.");
     18     else
     19         printf("\nThis is not a perfect square.");
     20     return 0;
     21 }
© 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