first.c
that will print the
integers 0 to 9, one number per line.
#include<stdio.h>
int main() {
int x = 0;
while (x<10) {
printf("%d\n", x);
x++;
}
}
second.c
that will print the
integers from 50 down to 37, one number per line.
#include<stdio.h>
int main() {
int x = 50 ; //second change
while (x>36) { //third change
printf("%d\n", x);
x--; //first change
}
}
second.c
#include<stdio.h>
int main() {
int x = 50 ; //second change
while (36<x) { //third change
printf("%d\n", x);
x--; //first change
}
}
third.c
that will print the
odd integers from 137 up to 153.
#include<stdio.h>
int main() {
int x = 137 ; //second change
while (x<154) { //third change
printf("%d\n", x);
x += 2; //first change
}
}