#include <stdio.h>
char letraDNI(unsigned long dni);
int main(int argc, char *argv[])
{
unsigned long dni;
if (argc != 2)
printf("El número de argumentos no es correcto \n");
else {
dni = atoi (argv[1]);
printf("DNI: %li-%c \n",dni,letraDNI(dni));
}
return 0;
}
char letraDNI(unsigned long dni)
{
char letras[23]={'T','R','W','A','G','M','Y','F','P','D','X','B','N','J','Z','S','Q','V','H','L','C','K','E'};
return letras[dni%23];
}