Integer (Number) to Integer Array Conversion in C++

Source code :

#include <iostream>
#include <string.h>

#define __SIZE__ 6

using namespace std;

int main()
{
	
	int a=12356;
	int b[__SIZE__];
	int i=0,rem,rev;
	int out[__SIZE__];
	int ini=0;

	while(a!=0)
	{
		rem=a%10;
		rev=rev*10+rem;
		a=a/10;
		b[i]=rem;
		i++;
	}
	
	for(i=__SIZE__-1;  i>=0; i--){
	out[ini]=b[i];
	++ini;
	}

	for(i=0; i<__SIZE__; i++){
	    cout<<out[i]<<"\t";
	}
	
	return 0;
}

Output :

1	2	3	5	6

Output :


                

Comments :