07-12-2011, 11:03 PM
adding rows and columns of a multi array in c++ 2011
Code:
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
using namespace std;
void call( const int [][ 6 ] );
void call( const int a[][ 6 ] )
{
for ( int i = 0; i < 5; i++ )
{
for ( int j = 0; j < 6; j++ ){
cout << a[ i ][ j ] << ' ';
}
cout << endl;
}
}
int main()
{
int array[ 5 ][ 6 ] = { { 141, 567, 434, 100, 269, 324 },
{ 578, 458, 562, 564, 305, 245 },
{ 381, 427, 561, 591, 595, 542 },
{ 427, 536, 491, 204, 502, 253 },
{ 392, 482, 521, 316, 318, 495 } };
cout << "original array" << endl;
call( array );
return 0;
}0300-9520262
Get solution in 24 hour |cpmputer & internet
mileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
