#include<time.h>#include<stdio.h>#include<stdlib.h>#include<string.h>/* alphabet: [a-z0-9] */constcharalphabet[]="abcdefghijklmnopqrstuvwxyz0123456789";/** * not a cryptographically secure number * return interger [0, n). */intintN(intn){returnrand()%n;}/** * Input: length of the random string [a-z0-9] to be generated */char*randomString(intlen){char*rstr=malloc((len+1)*sizeof(char));inti;for(i=0;i<len;i++){rstr[i]=alphabet[intN(strlen(alphabet))];}rstr[len]='\0';returnrstr;}intmain(intargc,char**argv){// the seed for a new sequence of pseudo-random integers// to be returned by rand()srand(time(NULL));char*p;p=randomString(10);printf("%s\n",p);free(p);p=randomString(11);printf("%s\n",p);free(p);p=randomString(12);printf("%s\n",p);free(p);}