-
-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathprogram 47.c
More file actions
33 lines (28 loc) · 667 Bytes
/
program 47.c
File metadata and controls
33 lines (28 loc) · 667 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
/* 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;
}