#include
using namespace std;
int main() {
int n;
cin>>n;
int a[100];
int n1,r,q,i;
n1=n;
i=0;
while(n1!=0)
{
r=n1%10;
n1=n1/10;
a[i]=r;
i++;
}
n=sizeof(a)/sizeof(a[0]);
for (i=0;i<n;i++)
cout<<a[i]<<’\t’;
return 0;
}
this is my code for the Chewbacca and Number, HackerBlocks Tutorial
I wanted to put all the digits of a number in an array and then interchange the digits with 9-i.
In this process I wanted to display the array I am getting the array but after that, some unwanted garbage values are being displayed.
can I know how to get rid of the garbage values.