Note that the following are intended for the instructor, not always directly for the student. If used well they require some analysis, not just coding, from the student.
Use the fact that the sum of the first n odd numbers is $n^2$ to compute the integer square root of an integer.
Test data should include 63, 64, and 65 to catch edge cases.
This can be extended past the decimal point and optimized in various ways to compute more accurate approximations of square roots.
Notes on the above, but I suggest you try it before peeking:
To make it a bit more obvious, this involves using inverse functions and computing inverses. The loop actually needs to count subtractions and uses facts about perfect squares to compute square roots. That same idea might be exploited for other problems.
Note that $\lfloor$ $\sqrt 65$ $\rfloor$ = 8.
Other simple things:
How many digits does an integer have?
How many bits are required to represent an integer? (Note that the structure is the same as the above)
How many times does zero (for example) appear in the decimal representation of an integer.
Sum of the digits of a given integer.
Is the number of 1 bits in a binary representation of an integer even or odd?
Read a real value x from input. Then read the successive coefficients of a polynomial from input and evaluate the polynomial at x. Note that the stopping condition needs to be specified and by varying it you can have different systems. Reading it from input is one of the obvious variations. Hardcoding it is another. Later on, the coefficients can be in an array, of course.
In teaching loops it is important to also give exercises where the correct number of iterations is zero. For example, give x and y, find the number of multiples of 3 that are larger than x but less than y. Don't exclude the initial condition y < x.
Nested loops: Once you have the solution to "is X prime?", how many primes are there between a given x and y?
A bit harder:
Euclid's algorithm.
Extensions:
A solution to the square root problem follows, using a personal (executable) pseudocode:
$ "Computes the integer square root of a non-negative number";
With
value; current; count; odd; // integer variables
Program
Read value;
current <- value;
count <- 0;
odd <- 1;
While current >= odd {
current <- current - odd;
odd <- odd + 2;
count <- count + 1;
}
Print "The integer square root of ", value, " is ", count;
End