Hackety Hacking Problem Factorial: Difference between revisions
Jump to navigation
Jump to search
(New page: == Problem Statement == You have a word each made up of different letter no letter repeated.You have been given the length of the word.Now the problem is that you have to print the number...) |
No edit summary |
||
Line 11: | Line 11: | ||
So you have to write a program which takes the word length as the input from the user,And prints the number of ways in which they can be arranged. |
So you have to write a program which takes the word length as the input from the user,And prints the number of ways in which they can be arranged. |
||
== Constrains == |
|||
*There can be more than one way to solve it. |
|||
*You have to use recursion. |
|||
* |
|||
== Sample Output == |
|||
Enter the word length : 5 |
|||
The number of ways the word can be arranged is = 120 |
|||
== Curriculum Connections == |
Revision as of 03:14, 23 October 2007
Problem Statement
You have a word each made up of different letter no letter repeated.You have been given the length of the word.Now the problem is that you have to print the number of ways in which the letters can be arranged to return a new word. For Example: Word Length=3 take a word "bat" It can be written in 6 different ways: abt atb bat bta tab tba
So you have to write a program which takes the word length as the input from the user,And prints the number of ways in which they can be arranged.
Constrains
- There can be more than one way to solve it.
- You have to use recursion.
Sample Output
Enter the word length : 5 The number of ways the word can be arranged is = 120