for(loop = 0;loop<=5;loop++) 
{ 
  Value[loop] = counter % 10; 
  counter = counter / 10; 
}