this is the first problem set in cs50
i think that ihave a problem with thefor loop
plz help
this is my code for isbn.c
the code decremented by 9 ? when i give 5641615 the prog give me 5641606Code:#include <cs50.h> #include <stdio.h> int main( int argc , char *argv[]) { printf("isbn-num :"); long long isbnum = GetLongLong(); int sum=0; int i; for ( i= 10;i>0;i--) { int ldigi = (isbnum % 10) ; isbnum = (isbnum-ldigi); printf("%d \n",isbnum ); } }
thanx