Can you fix this BUG??

by Guest 6/27/2008 9:08:24 PM


You would have fixed lot of bugs till today..

If so, there is a challenge for you..  Can you fix this one??



##########################################################

#include
<stdio.h >
#define LAST 10

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

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

  printf("Sum = %d",sum);
}
##########################################################

I know its a tough one.. It could be fixed like this..Smile
..
..
..
..
..
..
..
..
..
..

..

..

......

..

......

..

..

..

..

....

..

##########################################################
#include stdio.h;
#define LAST 10

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

/*

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

  printf("sum = %d\n", sum); 
  return 0;
}
 
##########################################################

-Madhav 

Currently rated 5.0 by 6 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags: ,

Fun Stuff

Related posts

Comments

7/1/2008 1:20:40 PM

This is cool..

Swetha in

Comments are closed

Add/Search Topic

Post a new topic!



Calendar

<<  July 2010  >>
MoTuWeThFrSaSu
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

About IT Pepper

IT Pepper is the Official Indian IT & ITES Employee blog! Share your experience, thoughts, feelings or emotions anonymously.

Click here to post your story.

E-mail us Send mail