C - Loops
How can you modify this code to print all even numbers from 2 to 10 using a while loop?
int num = 1;
while (num <= 10) {
printf("%d ", num);
num++;
}int num = 1;
while (num <= 10) {
printf("%d ", num);
num++;
}15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions