c programming

5 pts.
Tags:
C
Debugging
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);

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • carlosdl
    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).
    69,365 pointsBadges:
    report
  • Tulasi1234
    i want to share my computer and it knowledge
    10 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following