Monday, June 4, 2007

Remove the Bug in this code


/* 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;

}

4 comments:

kenzor said...

The error message would be helpful but I'm guessing the space between the < and the =.

Dave said...

Easy.

Open up notepad, load the page and remove the stupid image001.gif tag.

There. Bug now gone.
Man I'm brilliant.

Mohamed said...

Easy......

Just Comment the image.

/*



*/ like this

rahul chhabra said...

mast hai yaar