Programa Calcular Dni En C

  • Uploaded by: Adrián Espinosa
  • 0
  • 0
  • May 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Programa Calcular Dni En C as PDF for free.

More details

  • Words: 119
  • Pages: 1
/* ___________________________________________________________ | Titulo: Cálculo del DNI en C Version: 1.0 | | Autor: Mortuus | | Descripcion: Calcula la letra del dni introducido | ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ */ #include <stdio.h> #include int main() { char letras[]="TRWAGMYFPDXBNJZSQVHLCKE\0";// Array o vector para calcular la letra int dni; int letra; printf("Introduce tu dni\n"); scanf("%d", &dni); if ( dni <= 99999999 ) // si el DNI es menor a 99999999 { letra = dni % 23; // haremos el modulo del numero entre 23 printf("Tu dni es %d - %c", dni, letras[letra]); // introducimos el resultado de la operacion en el array o vector getch(); } else // si es mayor a 99999999 { printf("No has introducido un numero valido"); getch(); } }

Related Documents


More Documents from ""

Calentamiento Global.pdf
April 2020 16
Expo-legislacion.pptx
November 2019 9
December 2019 16
Acordes Y Cancion Help.docx
November 2019 25