#include <memory.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
#include <stdio.h>
#include <iostream.h>
//#include <stdio.h>

void main( void )

{

//  PHONE LETTER to NUMBER possibility sorter.

  char button[35] = {"000111ABCDEFGHIJKLMNOPRSTUVWXY"} ;
  char co[7];
  short number[10];
  int a=0;

  printf("\n\nPlease type telephone number X<enter>X<enter> [seven times total]\n");

  for( int i=0;i<7;i++ )
  {
    number[i] = getchar();;
  }

  printf("\n\nNow Working\n");

  for( int i=0;i<3;i++ )
  {
    co[0]=button[((number[0])*3+i)];

    for( int j=0;j<3;j++ )
    {
      co[1]=button[((number[1])*3+j)];

      for( int k=0;k<3;k++ )
      {
       co[2]=button[((number[2])*3+k)];a++;

       for( int l=0;l<3;l++ )
        {
         co[3]=button[((number[3])*3+l)];a++;

         for( int m=0;m<3;m++ )
         {
           co[4]=button[((number[4])*3+m)];a++;

           for( int n=0;n<3;n++ )
           {
             co[5]=button[((number[5])*3+n)];a++;

             for( int o=0;o<3;o++ )
             {
               co[6]=button[((number[6])*3+o)];a++;

               for(int p=0; p<7; p++)   // output letter combo
                 putchar(co[p]) ;
                 putchar('\n');          // issue newline

             }  // ...
           } // ...
         } // ...
       }  // ....
      }   // ....
    }   // second letter
  }  // first letter
} // main
