• Lenguaje

    C

  • Descripción

    Solicite 10 números al usuario y mostrar cuantos de ellos son mayores a 100.

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, mayores_que_100;
    float un_numero;
    mayores_que_100 = 0;
    for (i=1; i<=10; i++)
    {
        printf ("PROCESO %d\n", i);
        printf ("Ingresa el valor de un numero: ");
        scanf ("%f", &un_numero);
        (void) getchar ();
        if(un_numero>100)
            mayores_que_100=mayores_que_100+1;
        putchar ('\n');
    }
    printf ("Valor de mayores que 100: %d\n", mayores_que_100);
    system ("pause");
    return EXIT_SUCCESS;
}