/* 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
17 replies on “Can u get rid of this bug in the code below?”
that was kinda cool – refreshed my c skills a bit
also cleaned my monitor off its layer of dust!
this makes me wonder that even though we both interact a lot… i do not even know what profession are you engaged in
yes precisely even i dont have a clue
there is an orkut link in http://enagar.com/about/ which will have a more or less detailed description about me
i was talkg about myself
im a jack of all trades master of none
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 🙂
Awesome !
:)) ya the classic ostrich story… bury the head and hope that the problem goes away
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.
@vbr…
hey it has been a very long time since u have posted a ppost
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.
@param…
Sir the post is posted under humor and refers to the gif image of an actual fly embedded between the code.
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.
That was cool!
Hehe..perhaps you can tell me? I can’t find any mistake 😛
Good one!
Just want to say your article is as asnonishitg. The clearness in your post is just cool and i could assume you are an expert on this subject. Well with your permission let me to grab your feed to keep up to date with forthcoming post. Thanks a million and please continue the enjoyable work.