Skip to content

Instantly share code, notes, and snippets.

@merlinnusr merlinnusr/c.cpp
Created Apr 29, 2016

Embed
What would you like to do?
TAREA CUCEI
#include <iostream>
using namespace std;
int main ()
{
int Matriz[5][5]={{1,2,3,4,5},
{6,7,8,9,10},
{11,12,13,14,15},
{16,17,18,19,20},
{21,22,23,24,25}};
int suma_columna;
for(int i=0;i<5;i++)
{
suma_columna=0;
for(int c=0;c<5;c++)
{
cout<<"La posicion--> ["<<i<<c<<"]"<<" con valor de: "<< Matriz[c][i]<<"\n";
suma_columna+=Matriz[c][i];
if(c==4)
{
cout<<"La columa--> "<< i<<" suma un total de: "<< suma_columna<<"\n";
suma_columna=0;
}
}
}
system("PAUSE");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.