U A C M

¿Quieres reaccionar a este mensaje? Regístrate en el foro con unos pocos clics o inicia sesión para continuar.
U A C M

Universidad Autónoma de la Ciudad de México


    PROGRAMA QUE IMPRIMA LA SUMA DE LOS 100 PRIMEROS NUMEROS

    Krlos
    Krlos
    Admin


    Mensajes : 72
    Fecha de inscripción : 11/05/2011

    PROGRAMA QUE IMPRIMA LA SUMA DE LOS 100 PRIMEROS NUMEROS Empty PROGRAMA QUE IMPRIMA LA SUMA DE LOS 100 PRIMEROS NUMEROS

    Mensaje  Krlos Vie Mayo 20, 2011 4:16 pm

    /* PROGRAMA QUE IMPRIMA LA SUMA DE LOS 100 PRIMEROS NUMEROS
    AUTOR: CARLOS E. LOPEZ */

    #include <stdio.h>
    #include <stdlib.h>
    main()
    {
    int num;
    float suma=0;
    printf("\n\n\t\tPROGRAMA QUE IMPRIME LA SUMA DE LOS 100 PRIMEROS NUMEROS\n\n\n");
    for(num=1;num<=100;num=num+1)
    {
    printf("%d\t",num);
    suma=suma+num;
    }
    printf("\n\n\t\tLA SUMA DE LOS 100 PRIMEROS NUMEROS es: %f", suma);
    printf("\n\n\t\t");
    system("PAUSE");
    return 0;
    }

      Fecha y hora actual: Dom Mayo 19, 2024 6:52 am