31-05-2008, 08:19 PM
|
| | | Join Date: Jan 2008 Location: Islamabad
Posts: 20
Contact Number: +92-321-6334272 Program / Discipline: Alumni Class Roll Number: 0108 | |
How will you Fix this Bug ......? Remove this bug from code........ ........ ############ ######### ######### ######### ######### ######### # #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;
} ############ ######### ######### ######### ######### ######### # Think.... Think Hard ....
And the developer fixes it this way (As they do for most of the critical bugs)
...
..
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
..
...
... ..
... .. .. .. ...... .. ...... .. .. .. .. .... .. ############ ######### ######### ######### ######### ######### #
#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;
} ############ ######### ######## ############ ######### #######
__________________
Kamran Qadir
|