Question: In C program 1. (50 points) A bank requires the PINs for their ATM cards to be a sequence of digits without repetition. For example,

 In C program 1. (50 points) A bank requires the PINs

In C program

1. (50 points) A bank requires the PINs for their ATM cards to be a sequence of digits without repetition. For example, 5632 is a valid PIN and 4543 is not a valid PIN. Write a program to create a random PIN without repeated digits, given the length of the PIN. A sample input/output: Enter the length of the PIN: 6 Output: 563209 1) Name your program PIN.C. 2) In the main function, the program will ask the user to enter the length of the PIN and validate the length. The length should be in the range of 2 to 8, inclusive. 3) Include the function create() in the program. The create() function creates a randomized integer array of length n representing the digits of the PIN, and ensures that there is no repeated numbers in the array. void create (int all, int n); 4) The main function calls the create function and displays the output. How to use the rand() function to generate a random number: 1) To use the rand() and time function in a program, include and 2) With the help of rand() function, a number in range of lower to upper can be generated as num = (rand() % (upper - lower + 1)) + lower 3) rand() function generates the same sequence again and again every time the program runs. Use srand() function with time to set seed for rand() function so it generates different sequences of random numbers. Include the following statement at the beginning of the create function: srand(time(NULL))

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!