sábado, 6 de septiembre de 2014

17. Que muestre los primeros 100 números de izquierda a derecha usando un array de dos dimensiones, la última fila a mostrará la suma de sus respectivas columnas.

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[])
{

    int x,y,sum, numeros[11][10];
   
    for (y=0;y<10;y++)
    {
        sum=0;
        for (x=0;x<10;x++)
        {
            numeros[x][y]=(x*10)+1+y;
            sum=sum+numeros[x][y];
        }
        numeros[10][y]=sum;
    }
   
    for (x=0;x<11;x++)
    {
        for (y=0;y<10;y++)
        {
            printf("%d ",numeros[x][y]);
        }
        printf("\n");
    }
   
    system("PAUSE");     
    return 0;

}

1 comentario:

  1. 1xbet korean casino review - Legalbet
    1xbet korean casino review. We 1xbet korean have reviewed 1xbet 카지노사이트 gaming site and will update it with information. The site 인카지노 was not created by one software provider

    ResponderEliminar