Ultra Spectra

Fun Solutions | Bug found and Fixed!

Posted on: September 19, 2009


Howdy, guys!

I have been asked about the bugs for their solutions since long by my clients but today I got a really interesting bug to tackle and get it fixed!

Here goes the bug in the code and how it can be fixed 😉 Enjoy…

Bug:

#include


#define LAST 10

int main()
{
int i, sum = 0;

bug

for ( i = 1; i < = LAST; i++ )
{
sum += i;
}

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

Bug Fixed:

#include stdio.h;
#define LAST 10

int main()
{
int i, sum = 0;
/*

bugfixed
*/
for ( i = 1; i < = LAST; i++ )
{
sum += i;
}

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

See the bug is fixed now 😉 haha!

Advertisements

1 Response to "Fun Solutions | Bug found and Fixed!"

The Bug has been removed successful.
Please now Debug. 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

My Gravatar


Ultra Spectra is a personal interest blog for publishing news articles, sharing interesting information or the research.

UltraSpectra’s Blogging World

UltraSpectra

UltraSpectra

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 7 other followers

Share this Blog

Bookmark and Share

Subscribe

Tell a Friend
September 2009
M T W T F S S
« Aug   Oct »
 123456
78910111213
14151617181920
21222324252627
282930  

RSS UltraSpectra’s RSS

  • Hello world!
    Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

My Twtter Updates

Blog Stats

  • 129,969 Visits

Top Clicks

  • None
Advertisements
%d bloggers like this: