c++

Print based on user input

Ex:

How multifarious: 24

Rows: 4

Columns: 6

What estimate to print: 1

**C++ code:**

//This program gain estimate of lines and colums.

//No:of elements are sound used ce printing singly. Matrix can be created from line and colum enumerate.

// The estimate to be printed is inputed and stored in matrix, that is matrix[i][j]=number, fills the dispose with rate in wavering estimate

#include<iostream>

using namespace std;

int ocean()

{

int matrix[5][5],row,col,number,i,j,count;

cout<<“How multifarious elements:”;

cin>>count;

cout<<“Enter no.of lines:”;

cin>>row;

cout<<“Enter no.of columns:”;

cin>>col;

cout<<“What estimate to print:”;

cin>>number; //reads the estimate in the matrix

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

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

matrix[i][j]=number;//fills the dispose with given rate

cout<<“The Matrix is:n”;

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

{

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

{

cout<<matrix[i][j]<<” “; //print matrix

}

cout<<“n”; // to go to contiguous line

}

return 0;

}

Output: