Can someone help me make a c program Follow the instructions
Solution
#include<iostream>
 #define ROW 100
 #define COL 100
 using namespace std;
// Prototype of the functions
 void acceptMatrixData(int mat[][COL], int, int);
 void displayMatrixData(int mat[][COL], int , int);
// main function definition
 int main()
 {
 // Declares a matrix with ROW and COL size
 int matrix[ROW][COL];
 // To store the row and column size of the matrix
 int row, col;
 // Accepts row and column size
 cout<<\"\  Enter the row size: \";
 cin>>row;
 cout<<\"\  Enter the column size: \";
 cin>>col;
 // Calls the function to accept data for matrix
 acceptMatrixData(matrix, row, col);
 // Calls the function to display data for matrix
 displayMatrixData(matrix, row, col);
 }// End of main function
// Function to accept matrix data
 void acceptMatrixData(int mat[][COL], int row, int col)
 {
 int r = 0, c;
 cout<<\"\  Enter the data for \"<<row<<\" x \"<<col<<\" matrix: \";
 // Outer loop using while for each row
 while(r < row)
 {
 //Inner loop using for loop for each column
 for(c = 0; c < col; c++)
 {
 cout<<\"\  Enter the data for [\"<<(r + 1)<<\", \"<<(c + 1)<<\"] : \";
 cin>>mat[r][c];
 }// End of for loop
 // Increase the row counter by one
 r++;
 }// End of while loop
 }// End of function
// Function to display the matrix
 void displayMatrixData(int mat[][COL], int row, int col)
 {
 cout<<\"\  Contents of the Matrix: \ \";
 int r = 0, c;
 // Outer loop using while for row
 while(r < row)
 {
 // Inner loop using for loop for column
 for(c = 0; c < col; c++)
 {
 cout<<\" \"<<mat[r][c];
 }// End of for loop
 cout<<endl;
 // Increase the row counter by one
 r++;
 }// End of while loop
 }// End of function
Sample Run:
 Enter the column size: 3
Enter the data for 3 x 3 matrix:
 Enter the data for [1, 1] : 10
Enter the data for [1, 2] : 20
Enter the data for [1, 3] : 30
Enter the data for [2, 1] : 40
Enter the data for [2, 2] : 50
Enter the data for [2, 3] : 60
Enter the data for [3, 1] : 70
Enter the data for [3, 2] : 80
Enter the data for [3, 3] : 90
Contents of the Matrix:
 10 20 30
 40 50 60
 70 80 90


