#include<stdio.h>
#include<math.h>
int main()
{
int n,t;
clrscr();
printf("Enter n value :");
scanf("%d",&n);
t=sqrt(n);
printf("%d \n",t);
if(n==t*t)
{
printf("Given number is Perfect Square %d",t);
}
else
printf("Given number is Not perfect");
getch();
}
output
#include<math.h>
int main()
{
int n,t;
clrscr();
printf("Enter n value :");
scanf("%d",&n);
t=sqrt(n);
printf("%d \n",t);
if(n==t*t)
{
printf("Given number is Perfect Square %d",t);
}
else
printf("Given number is Not perfect");
getch();
}
output
Enter n value :49
7
Given number is Perfect Square 7
7
Given number is Perfect Square 7
0 comments:
Post a Comment