RANDOM "PASSWORD GENERATOR" -C
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
void main()
{
char passwordint[50],password[50];
int lenght;
printf("enter the lenght of your password in multiple of 3x ");
scanf("%d", &lenght);
srand(time(NULL));
for (int i = 0; i < lenght; i++)
{
for (int j = 0; j < lenght/3; j++)
{
passwordint[j] = rand()%10; //random number generator
password[j+1]='A'+rand()%26; //random uppercase letter generator
password[j+2]='a'+rand()%26; //random lower case letter generator
printf("%d%c%c", passwordint[j],password[j+1],password[j+2]);
}
}
}
0 comments:
Post a Comment