The name of your C program file must be called square1.c, files with any other name will not be marked.
n * n
for some natural number n. The sequence of square numbers for n = 1, 2, 3... is:
1, 4, 9, 16, 25, 36, 49, 64, 81, 100, ...
Keep prompting the user to enter an integer until the user chooses to quit the program by entering a value of 0. When the user quits the program, display the number of integers entered, as well as the number of square and non-square numbers.
$ gcc -Wall square1.c -o square1 $ ./square1 Enter an integer (1 - 2000000000, 0 to quit): 1 1 is a square number. Enter an integer (1 - 2000000000, 0 to quit): 2 2 is between square numbers 1 and 4. Enter an integer (1 - 2000000000, 0 to quit): 97 97 is between square numbers 81 and 100. Enter an integer (1 - 2000000000, 0 to quit): 49 49 is a square number. Enter an integer (1 - 2000000000, 0 to quit): 50 50 is between square numbers 49 and 64. Enter an integer (1 - 2000000000, 0 to quit): 1999967841 1999967841 is a square number. Enter an integer (1 - 2000000000, 0 to quit): 2000000000 2000000000 is between square numbers 1999967841 and 2000057284. Enter an integer (1 - 2000000000, 0 to quit): 0 Number of integers entered: 7 Square numbers: 3 Non-square numbers: 4 Thank you for using my program. Goodbye! $
A total of 10 different hosts have accessed this document in the last 445 days; your host, nsrp-source.comp.nus.edu.sg, has accessed it 11 times.
If you're interested, complete statistics for this document are also available, including breakdowns by top-level domain, host name, and date.