IBM interview question

Write a program for permutation