Friday, April 3, 2009

|Venad| Found a bug in the code


 Hi,

 

I found a bug in your code and I have fixed please take  a look…

 

 
#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; 
}
 
 
 

And I fixed it this way
 
 

.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
.
 
 

#include stdio.h; 
#define LAST 10 

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

 
   // Fixed. Doesn't move anymore. 

for ( i = 1; i < = LAST; i++ ) 

     sum += i; 


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


 

With Warm Shaken,

Asir Devadasan Raja

13191262510691913416 
  "If your ship hasn't come in, Swim out to it ...."
 Image and video hosting by TinyPic
ASIR DEVADASAN

 

Note :

I AM SHARING WHAT WAS SHARED WITH ME!
Something u don't like use the delete key and move on !.. Thnx....



Add more friends to your messenger and enjoy! Invite them now.

No comments:

Post a Comment