Hi,
Feeling bored? Then pls help me if u know C.
Please help me to get the bug out of my code.
Please find the code below?
It is a very simple C program and bug is also so small?
But, am not able to remove the bug from the 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;
}
Feeling bored? Then pls help me if u know C.
Please help me to get the bug out of my code.
Please find the code below?
It is a very simple C program and bug is also so small?
But, am not able to remove the bug from the 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;
}



Comment