#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include<conio.h>
int n;
char *rand_str(char *dst, int size)
{
static const char text[] = "abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"1234567890"
"`~!@#$%^&*()_+,./;':?><[]{}|\"";
int i,len=rand()%(size-1);
for ( i = 0; i < n ; ++i )
{
dst[i] = text[rand() % (sizeof text - 1)];
}
dst[i] = '\0';
return dst;
}
int main (void)
{
clrscr();
printf("\n\n\n\t\t\tPASSWORD DEVELOPER\n\n\n");
printf(" enter the length of password required\t");
scanf("%d",&n);
char mytext[10];
srand(time(0));
gotoxy(9,10);
printf("a C programmed random password is ");
puts(rand_str(mytext, sizeof mytext));
printf("\n\thit any key to exit......");
getch();
return 0;
}
I KRISHNAPRASAD PURSUING MY B.TECH IN C.R.REDDY COLLEGE OF ENGINEERING TRADE COMPUTER SCIENCES AND ENGINEERING. I'M HAPPY TO PRESENT ALL TYPE OF PROGRAMS. I HOPE U UTILISE THIS BLOG AND ENJOY YOUR PROGRAMMING. THESE PROGRAMS ARE BEST COMPILED IN TURBO C++ COMPILERS AND SUN JAVA COMPILERS
Friday, July 30, 2010
PASSWORD DEVELOPER
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment