Cielo Benítez / Mbed 2 deprecated Pract4_ejer4

Dependencies:   mbed

main.cpp

Committer:
cielo
Date:
2020-04-12
Revision:
26:b936177af0ea
Parent:
25:7dad1f41744f

File content as of revision 26:b936177af0ea:

#include  "mbed.h"   
#include "iostream"

using namespace std;
Serial com1(USBTX,USBRX); // PARA USAR LOS PINES UART

int main(){
    char n;
    com1.printf("Digite un numero entre 0-9: ");
    com1.scanf(" %c",&n);
    switch(n){
        case 48:printf("Es el numero 0");
        break;
        case 49:printf("Es el numero 1");
        break;
        case 50:printf("Es el numero 2");
        break;
        case 51:printf("Es el numero 3");
        break;
        case 52:printf("Es el numero 4");
        break;
        case 53:printf("Es el numero 5");
        break;
        case 54:printf("Es el numero 6");
        break;
        case 55:printf("Es el numero 7");
        break;
        case 56:printf("Es el numero 8");
        break;
        case 57:printf("Es el numero 9");
        break;
        default: 
        com1.printf("No se encuetra entre los numeros 0-9");
        break;
        }
    return 0;

    }