my looping code failed,
it reads unlimited number readin,
whats wrong with it i didnt figure it out,
here's my problem
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);
}
}
Thats for while loop,
here is with do while loop,
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);
}
okay, sorry if my code is "unreadable" like other guy said yesterday to me. This the best i can do to explain my problem.
Any ideas?