Babbage problem: Difference between revisions

Content deleted Content added
No edit summary
Line 173:
int main() {
int current = 0, //the current number
square = 0; //the square of the current number
 
//the strategy of take the rest of division by 1e06 is
//to take the a number how 6 last digits are 269696
do {
square = current * current;
current++;
} while ((square % 1000000 != 269696)&&(square<INT_MAX));
 
//output
if (square>+INT_MAX)
printf("Square do not found in the C type limits\n");
else
printf("The square of %d is %d\n", current, square);
//the end
return 0 ;
}