Generate Unique password program
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main()
{
int i,password,len;
srand((unsigned int)time(NULL));
printf("\n\n\n\t\t\t ENTER THE PASSWORD LENGHT AND MUST BE GREATER THAN 5 : ");
scanf("%d",&len);
if(len>=5&&len<=20)
{
for(i=0;i<len;i++)
{
int k=rand()%128;
if((k>=48&&k<=57)||(k>=65&&k<=90)||(k>=97&&k<=122)||(k>=35&&k<=37)||k==64)
{
printf("%c",k);
}
else
{
i--;
}
}
printf("\n");
}
else
{
printf("\n\t\t\t LENGTH SHOULD BE GREATER THAN 5 and equal or less than 20 !!! ");
}
return 0;
}
Video link : https://youtu.be/weQYMCiEIds

Comments
Post a Comment