// permutations.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "iostream.h"

void Permutation ( char restofword[5], int location, int length);

int main(int argc, char* argv[])
{
	char word[5]="ABCD";
	char newword[5];
    int i;

	i=0;
	{
      cout<<word[i];
	  Permutation (word, i+1, 4-i);
      cout<<endl;
	}

	return 0;
}

void Permutation ( char restofword[5], int location, int length)
{
    char letter;
	int i;
    if (length >1)
	{
           letter=restofword[location];
	        cout<<letter;
		    Permutation (restofword, location+1, 4-location);
		
	}
	else
	{
         letter=' ';
		 cout<<letter;
	}


}
