I have a really weird problem with my code. it all looks fine to me, but when I input x it starts with a completely different number e.g. when I put in -15 it starts at 45. Can someone see the problem?
Code:main() { int c,x,y,count=0; printf("Enter the starting variable:"); x=getchar(); for(count=0;count<50;count++,x++) { c=(x/((x%10)+1))%x; y=(x-c)%50; printf("X=%d Y=%d\n",x,y); if(count%10==0) getch(); } getch(); return 0; }