I'm using Microsoft Visual C++ and have this lab due in a couple hours......
However, everytime I try to run it I keep getting "error C2668: 'sqrt' : ambiguous call to overloaded function", and for the life of me I cannot understand why......
Any help would be greatly appreciated! Thanks!
int i, n;
printf("Enter an Integer: ");
scanf("%d", &n); /* obtain number */
for(i=1;i<=n; i++) /* cycle through 1 to n */
s = sqrt(i); /* obtain the square root */
if (fmod(s,2) == 0) /* use floating point modular because sqrt returns a float */
/* if the remainder of a division by 2 is 0, then the number is even */
printf("%d\n", (int)i); /* print i value resulting in even square roots */
printf("Sorry, try inputting a positive number next time.\n");