HELLO FORUM,
please let me know the problem in the following code, when input is given as 12 am getting one two one as output whats the problem with the code. thanks in advance
PS:PLEASE FIND THE CODE IN ATTACHMENTS
Code:#include<stdio.h> void fun(int n) { int rem; while(n!=0) { rem=n%10; n=n/10; fun(n); rem==1?printf("one\n"):printf("two\n"); } } void main() { int x; scanf("%d",&x); fun(x); }