LIVE Course for free

Rated by 1 million+ students
Get app now
JEE MAIN 2023
JEE MAIN 2023 TEST SERIES
NEET 2023 TEST SERIES
NEET 2023
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
8.0k views
in Computer by (53.8k points)

Write a C++ program to read and print the elements of a two dimensional array.

1 Answer

+1 vote
by (48.4k points)
selected by
 
Best answer

#include<iostream.h>

#include<iomainp.h>

Void main()

{

int mat[3][5],rsize,csize,row,col;

count<<"Enter the order of matrix";

cin>>rsize>>csize;

count<<"Enter the matrix elements"<<endl;

for(row = 0;row<rsize;row++)

for(col=0;col<csize;col++)

cin>>mat[row][col];

count<<endl<<"The matrix elements are" <<endl;

for(row = 0;row<rsize;row++)

{

for(col=0;col<csize;col++)

count<<mat[row][col];

count<<endl;

}

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...