one number per line. Place a heading, "Even Numbers" above the list,
and the sum of the numbers below */
#include
int i, total;
int main () {
total = 0;
i = 0;
printf("Even Numbers: \n")
while(i <= 20){
printf("%d\n",i);
total = total + i;
i = i + 2;
printf("total is %d\n", total);
}
}


VulpesRank #55 · 29.2K reputationPosted Aug 7, 2012, 1:29 AM EDT
#include
int i, total;
int main () {
total = 0;
i = 10; // start from 10
printf("Even Numbers: \n"); // need semi-colon at end of this line
while(i <= 20){
printf("%d\n",i);
total = total + i;
i = i + 2;
printf("total is %d\n", total);
}
}