Code is to be done in C. Consider an array of characters char arr[] and max length
Question:
Code is to be done in C. Consider an array of characters char arr[] and max length ‘n’. Write a program with a recursive function that generates and prints all possible password combinations created using characters from the array ‘arr’ provided as command line input and having length, 1 <= length <= n, where ‘n’ is also a command line input
-
Create and submit only the main.c file
-
The printing and creation of the password should be done as a recursive function.
-
The input should be in command line and should be of type “./exeName M c1 c2 c3 N”
-
Here “exeName” is the name of the compiled executable
-
M is the number of allowable characters in the password, which will be followed after this. E.g., if allowable characters are ‘a’, ‘b’, ‘c’ then this M=3 and c1 = ‘a’, c2 = ‘b’ and c3 = ‘c’
-
N is the max length for the password
-
/* If we want ‘a’, ‘b’, ‘c’ and the max length of the password to be 2 */
// The way to run the code would be
./assignment7 3 a b c 2
// Output for the above run should be
a
b
c
aa
ab
ac
ba
bb
bc
ca
cb
cc
Fundamentals of Heat and Mass Transfer
ISBN: 978-0471457282
6th Edition
Authors: Incropera, Dewitt, Bergman, Lavine