Program 317:Password Generator using C
//Coming Soon...
Output:
#include <stdlib.h> #include <stdio.h> #include<time.h> int main() { int i,password,len; srand((unsigned int)time(NULL)); printf("Enter Password Length and must be greater than 5\n"); scanf("%d",&len); if(len>=5) { 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("Length should be greater than 5\n"); } return(0); }Explanation:
Output:
Can you explain to me what is the use of this line?: if((k>=48&&k<=57)||(k>=65&&k<=90)||(k>=97&&k<=122)||(k>=35&&k<=37)||k==64)
ReplyDeleteascii character value
DeleteI admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well. gasoline generator
ReplyDelete