my looping code failed,
it reads unlimited number readin,
whats wrong with it i didnt figure it out,
here's my problem
Thats for while loop,Code:int main() { int x; int y; int n; int m=0; printf("First Number =");scanf("%d",&x); printf("Divide Number =");scanf("%d",&y); printf("Loop Number =");scanf("%d",&n); while(m<n) { x+=y; printf("%d,",x); } }
here is with do while loop,
okay, sorry if my code is "unreadable" like other guy said yesterday to me. This the best i can do to explain my problem.Code:int main() { int x; int y; int n; int m=1; printf("First Number =");scanf("%d",&x); printf("Divide Number =");scanf("%d",&y); printf("Loop Number =");scanf("%d",&n); do{ x=x+y; printf("%d,",x); } while(m<n); }
Any ideas?



2Likes
LinkBack URL
About LinkBacks



