Define a two dimensional array named temp of three rows and four columns of type int such that the first row is initialized to, 6,8,12,9; the second row is initialized to 17,5,10,6; and the third row is initialized to 14,13,16,20.
#include <iostream>
#include <string>
#include <conio.h>
using namespace std;
int main(void){
int numbers[3][4]={{6,8,12,9},{17,5,10,6},{14,13,16,20}};
for(int i=0;i<3;i++){
for(int j=0;j<4;j++){
cout<<numbers[i][j]<<" ";
}
cout<<"\n";
}
system("pause");
return 0;
}
Comments
Leave a comment