• Lenguaje

    C

  • Descripción

    Digitar 4 números por pantalla. Determine e imprima cual es el número menor.

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

int main (void)
{
    int i;
    float menor, un_numero;
    menor = 0;
    for (i=1; i<=4; i++)
    {
        printf ("PROCESO %d\n", i);
        printf ("Ingresa el valor de un numero: ");
        scanf ("%f", &un_numero);
        (void) getchar ();
        if(i==1||menor>un_numero)
            menor=un_numero;
        putchar ('\n');
    }
    printf ("Valor de menor: %f\n", menor);
    system ("pause");
    return EXIT_SUCCESS;
}