You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
721 B
C

#include <time.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
/* Length of the password */
int length;
int num;
int temp;
printf("Enter the length of the password: ");
scanf("%d", &length);
printf("\nEnter the number of passwords you want: ");
scanf("%d", &num);
/* Seed number for rand() */
srand((unsigned int) time(0) + getpid());
while(num--)
{
temp = length;
printf("\n");
while(temp--)
{
putchar(rand() % 56 + 65);
srand(rand());
}
temp = length;
}
printf("\n");
return EXIT_SUCCESS;
}