My code is not giving output?
@Deepanshu_garg
There are two seperate issues with your code.
Both in the same line.
First issue is why you were not getting any output.
This is because when you type casted arr[k] to char and appended it in the string , the ASCII character corresponding to that digit got appended instead of the actual digit. In order to append the digit you should write
char ( arr [ k ] + ‘0’ )
Add the ASCII value of character ‘0’ to get the digit instead of ASCII character corresponding the array value.
This will resolve the no output issue.
But your code does not give the correct output. That is an entirely different issue. You need to figure this one out yourself. I’ll provide you with a hint a though - As I said earlier , both the issues are in the same line of code. So just keep your eyes on Line No. 15 only and stop looking anywhere else.