How to insert and display values in a two dimensional array in c++?
Zaarm Tech Selected answer as best November 20, 2021
#include<iostream.h> #include<conio.h> #define WIDTH 5 #define HEIGHT 2 void main() { int a[HEIGHT][WIDTH]; int n, m; clrscr(); for(n=0; n<HEIGHT; n++) { for(m=0; m<WIDTH; m++) cin>>a[n][m]; } cout<<endl<<endl; for(n=0; n<HEIGHT; n++) { for(m=0; m<WIDTH; m++) cout<<a[n][m]<<endl; } getch(); }
Zaarm Tech Selected answer as best November 20, 2021