Saturday, March 13, 2021

C program to Check for a Perfect Square or not

 

C program to Check for a Perfect Square or not

#include <stdio.h>
#include <math.h>
int main()
{
    int n,m;
    float p;
    printf("Enter any number : ");
    scanf("%d",&n);
    p=sqrt(n);
    m=p;
    if(p==m)
    printf("%d is perfect square number",n);
    else
    printf("%d is not perfect square number",n);
    return 0;
}

No comments:

Post a Comment