sami sam

sami sam

  • NA
  • 40
  • 30.2k

I do not know where I went wrong, Could some one help me please

Aug 7 2012 5:22 AM
/* Write a program that will print all the even numbers from 10 to 20 inclusive,
one number per line. Place a heading, "Even Numbers" above the list,
and the sum of the numbers below */

#include <stdio.h>
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);
  }
}

Answers (1)