PDA

View Full Version : Fixing the Bug


Jupiter
27th March 2008, 01:39 PM
A bug is found in the code.....

#include < stdio.h >
#define LAST 10

int main()
{
int i, sum = 0;
http://img524.imageshack.us/img524/6340/bug1rw3.gif
for ( i = 1; i < = LAST; i++ )
{
sum += i;
}

/*-for-*/
printf("sum = %d\n", sum);
return 0;
}

This how the developer fixes it...........
























#include stdio.h;
#define LAST 10

int main()
{
int i, sum = 0;
/*
http://img524.imageshack.us/img524/7811/bug2me9.gif
*/
for ( i = 1; i < = LAST; i++ )
{
sum += i;
}

/*-for-*/
printf("sum = %d\n", sum);
return 0;
}

:D:D:D

airINDIA
27th March 2008, 01:42 PM
Oye... ye to lele ka purana Avtar daal diya code mein... :001_rolleyes:

Jupiter
27th March 2008, 01:43 PM
Oye... ye to lele ka purana Avtar daal diya code mein... :001_rolleyes:


Well no comments on the relation of Lele n the bug...

Mastikhor
27th March 2008, 01:48 PM
lele ke avtar ko code diya :w00t:

dengu
27th March 2008, 06:14 PM
lele ke avtar ko code diya :w00t:

:D:D:D............

Khopdi
27th March 2008, 09:31 PM
:thumbup: :award: :hi_5:

Nice one Jupi Bhai.

aaichaagho
28th March 2008, 12:44 AM
Reading the title I almost thought that Jupi is going to fix the bug as in fixing a dog