• Lenguaje

    C

  • Descripción

    Clásico ¡Hola mundo! con ciclo.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

int main (void)
{
    char tecla_repetir;
    do {
        system ("cls");
        printf ("!Hola mundo!\n");
        putchar ('\n');
        printf ("\250Deseas repetir el proceso? (S/N): ");
        do {
            tecla_repetir = (char) getch();
        } while (tecla_repetir!='s' && tecla_repetir!='n' && tecla_repetir!='S' && tecla_repetir!='N');
        putchar ('\n');
    } while (tecla_repetir=='s' || tecla_repetir=='S');
    return EXIT_SUCCESS;
}