Home > Fun Stuff > Can u get rid of this bug in the code below?

Can u get rid of this bug in the code below?

December 2, 2007 Leave a comment Go to comments

/* add.c
* a simple C program
*/

#include <stdio.h>
#define LAST 10

int main()
{
int i, sum = 0;

for ( i = 1; i <= LAST; i++ )
{
sum += i;
} /*-for-*/
printf(”sum = %d\n”, sum);
return 0;
}

Categories: Fun Stuff
  1. No comments yet.
  1. No trackbacks yet.