5 pts.
 c programming
is there an error in this snippet if there is debug it for errors. int sum=0;i;2 for(i=10;j>=1;i=2); { sum+=j%i j+=3; } print("total accumulated sum=sum);

Software/Hardware used:
ASKED: July 24, 2008  1:09 AM
UPDATED: October 26, 2009  5:57 PM

Answer Wiki:
j is undeclared. If that was just a mistake I can't tell what you're trying to do. But what jumps out at me is that j is being incremented and therefore the loop will never terminate since the condition is j >= 1. ***************************************************** It would be useful to know what kind of error are you looking for: syntax ? logic ? Please tell us what you are trying to accomplish, and thus more help can be provided.
Last Wiki Answer Submitted:  September 16, 2008  4:29 pm  by  Jarro2783   30 pts.
All Answer Wiki Contributors:  Jarro2783   30 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

As Jarro said, the loop will never terminate, since j will always be >= 1 (or will never start if j is initialized with a a negative value).

 63,535 pts.

 

i want to share my computer and it knowledge

 10 pts.