So i am doing this for school and i dont know whats the problem The task of program is to read the number inputed and then write it from back to start like 123 it will return it 321 the code i wrote seems all ok to me but only error its giving is Id returned 1 exit status. I have absolutely no idea what could be so wrong in such small code so here it is. to make it easier to understand Nc is digits number and s is multiplier.c is like a last digit i extract from n before i divide it by 10 in my while loop. n is inputed number n1 is wanted number.
int main(int argc, char** argv) {
int n,nc,n1,c,s;
printf("Enter number: \n");
scanf("%d",&n);
while(n>0){
n/=10;
nc+=1;
}
s=pow(10,nc);
while(n>0){
c=n%10;
n1+=c*s;
s/=10;
n/=10;
}
printf("New number is %d",n1);
system("pause");
return 0;
}