[Solved] Why does this C function not return an integer value?


You should have

scanf("%d",&ch);

not

scanf("%d",ch);

Because the result of scanf gets stored in the variable named ch.

solved Why does this C function not return an integer value?