i use codeblocks for compiling.The following is the code that I have written.
if 1234 is entered then it produces the following resultCode:#include <stdio.h> #include <stdlib.h> int main() { int n; printf("enter the number\n\n"); scanf("%d",&n); printf("\n\n%d\n",n); while(n>0) { printf("%d\n",n/10); n=n/10; } return 0; }
1234
123
12
1
0
now i want to have only upto 1 and eliminate o.I am not able to do this can anyone help me.