Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Changing the loop to count n down rather than i. The problem is set up so that you view i as the active variable in the loop, but it doesn't have to be. */
- int i, n=42;
- main() {
- for(i=0; i<n; n--) {
- printf("*");
- }
- }
- /* Changing the loop so that i == -42 is the terminating condition rather than i == 42. */
- int i, n=42;
- main() {
- for(i=0; -i<n; i--) {
- printf("*");
- }
- }
- /* Same mechanic as #2, but with a less obvious way to do the comparison. */
- int i, n=42;
- main() {
- for(i=0; i+n; i--) {
- printf("*");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement