bsc

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

APC-PRAC-011.c (765B)


      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 /* Write a program to input positive number and check whether the number is
      8 perfect square or not. If the number is negetive then display appropriate message */
      9 
     10 #include <stdio.h>
     11 #include <math.h>
     12 
     13 int main()
     14 {
     15     int num, temp;
     16     printf("Enter the number : ");
     17     scanf("%d", &num);
     18     if (num < 0)
     19     {
     20         printf("\nYou entered a negetive number.");
     21         return 1;
     22     }
     23     temp = (int)sqrt(num);
     24     if (temp * temp == num)
     25     {
     26         printf("\nInput %d is a perfect square number.", num);
     27         return 0;
     28     }
     29     else
     30         printf("\nInput %d is not a perfect square number.", num);
     31     return 0;
     32 }
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror