Search This Blog

Friday, October 29, 2010

funny c program

remove the bug from the following 'C' program



#include
#define last 10
int main()
{
int i,sum=0;


for(i=1;i<=last;i++)

{
sum+=i;
printf("sum=%d",sum);
return 0;
}

3 comments:

  1. is there anyone who can debug this code......

    ReplyDelete
  2. #include
    #define last 10
    int main()
    {
    int i,sum=0;
    for(i=1;i<=last;i++)

    {

    sum+=i;

    printf("sum=%d",sum);

    return 0;

    }

    ReplyDelete
  3. naval you removed the bug
    the bug after the 5th line
    great work buddy......

    ReplyDelete