Using integer array instead of character array

Can we use integer array for solving the same array instead of using character array?

Hey @Tiwary725 you cannot take input as an integer array because integer array needs space between the two different integers but if you are willing to use scanf instead cin you can, so instead of scanf("%d", &n), you can use scanf("%1d", &a[i]) but even for this you need to know how many digits are present in the input, please refer to this article for more information about the same https://www.geeksforgeeks.org/input-an-integer-array-without-spaces-in-c/.

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.