/* 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;
}
Forwarded by Savitha
/* 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;
}
Forwarded by Savitha
RSS feed for comments on this post. TrackBack URI
that was kinda cool – refreshed my c skills a bit
also cleaned my monitor off its layer of dust!
Comment by Prax — November 23, 2007 @ 2:10 AM
this makes me wonder that even though we both interact a lot… i do not even know what profession are you engaged in
Comment by Ankur Aggarwal — November 23, 2007 @ 2:15 AM
yes precisely even i dont have a clue
Comment by Prax — November 23, 2007 @ 2:18 AM
there is an orkut link in http://enagar.com/about/ which will have a more or less detailed description about me
Comment by Ankur Aggarwal — November 23, 2007 @ 2:28 AM
i was talkg about myself
im a jack of all trades master of none
Comment by Prax — November 23, 2007 @ 2:30 AM
This bug has a very easy solution, which works for all bugs really. You just deny its existence and say it is “Working according to the use case”. Matter closed
Comment by Aditya — November 23, 2007 @ 2:13 PM
Awesome !
Comment by Voracious Blog Reader — November 23, 2007 @ 3:15 PM
Comment by Ankur Aggarwal — November 23, 2007 @ 3:16 PM
Or as put forward by Mustrum Ridcully Archchancellor of the Unseen University
The fastest way to deal with problems is to ignore them. If they are important enough someone will come to you with it rather than leaving a note.
Comment by Anonymous — November 23, 2007 @ 4:15 PM
@vbr…
hey it has been a very long time since u have posted a ppost
Comment by Ankur Aggarwal — November 25, 2007 @ 8:37 PM
It may be that if the value of LAST is increased the code will not work as sum will exceed the maximum integer value allowed. This will happen even LAST is much less than the maximum integer.
Otherwise I don’t think there is a clue. The issue is similar to the bug in JDK (resolved now) to find average of two integers.
Comment by Paramanand — November 26, 2007 @ 10:23 AM
@param…
Sir the post is posted under humor and refers to the gif image of an actual fly embedded between the code.
Comment by Ankur Aggarwal — November 26, 2007 @ 10:29 AM
Nice ankur, I thought that it was related to the flying bug, but it looks like my proxy server has banned the gif and so it was not visible here. I therefore thought that there is something important other than humor.
Comment by Paramanand — November 26, 2007 @ 1:45 PM
That was cool!
Comment by Vasuki — November 27, 2007 @ 4:32 AM
Hehe..perhaps you can tell me? I can’t find any mistake
Comment by ruhi — November 27, 2007 @ 8:42 AM
Good one!
Comment by Avinash — December 13, 2007 @ 2:39 PM