#include<stdio.h>#include<time.h> int main(){ int i; char aleatorio[10]; srand(time(NULL)); for(i=0; i <= 9; i++) aleatorio[i] = 33 + rand() % (126 - 33); printf("%s", aleatorio); return 0;}
#include <stdio.h>#include <time.h>#include <Windows.h> int main(){ int i; char aleatorio[10], cadena[]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; srand(time(NULL)); for(i=0;i<10;i=i+1){ aleatorio[i]=cadena[rand() % strlen(cadena)]; } aleatorio[i]='\0'; printf("%s",aleatorio); return 0;}