Unable to print leading zeroes

In this code I can not print leading zeroes.

https://ide.codingblocks.com/s/136279 Here is the xode

https://ide.codingblocks.com/s/136280 Another code where I used Sting.format("%05d,ans) to print leading zeroes but this prints only 5 digits .How can I print Digits in answer equal to the number of digits in input

The length of number is upto 100 in question … you have used int . Int can store only upto length 7 … use string for this .

Further XOR uses the following principle in which it converts decimal to binary and then solves and then return answer as decimal again .So the decimal will not have front zeroes

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

So do i need to convert the given input in decimal

just make a string and append your answer in the string and then print it

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.