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);
}
}

VulpesPosted Aug 7, 2012, 5:29 AM
#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);
}
}