Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int IsSquareRoot(int n)
- {
- if ((sqrt(n) * sqrt(n) == n))
- return 1;
- else
- return 0;
- }
- int main()
- {
- int x;
- for (x = 3; x <= 100; x++)
- {
- if (IsSquareRoot(x) == 1)
- printf("%i is a square root\n", x);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement