need to change this to a while loop help plz
for (x=1; x < 100; x++)
sum=sum +x;
need to change this to a while loop help plz
for (x=1; x < 100; x++)
sum=sum +x;
Code:x = 100; while (--x) sum+=x;
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
or
Code:x = 1; while (x < 100) { sum += x; x++; }
Mr. C: Author and Instructor
Thats a better versionOriginally posted by Mister C
or
Code:x = 1; while (x < 100) { sum += x; x++; }