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 }