//Print Perfect squares
from 50 to 200
#include<stdio.h>
#include<conio.h>
#include<math.h>
void
main()
{
int
x,y,c=0;
float
n;
clrscr();
printf("\n\nPerfect
Squares from 50 to 200 are\n\n");
//for loop with
initialization 50
for(x=50;x<=200;x++)
{
n=sqrt(x);
y=floor(n);
if(n==y)
{
printf("%d\t",x);
c++;
}
}
printf("\n\nTotal
Squares=%d",c);
getch();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.