In: Computer Science
for input matrix a , write a function to return the element in row 2 column 3 of that matrix
Since you have not mentioned language i'm doing this in python.
# A basic code for matrix input from user
R = int(input("Enter the number of rows:"))
C = int(input("Enter the number of columns:"))
# Initialize matrix
matrix = []
print("Enter the entries row wise:")
if(R!=0) and (C!=0):
# For user input
for i in range(R): # A for loop for
row entries
a =[]
for j in range(C): # A for loop for column
entries
a.append(int(input()))
matrix.append(a)
# For printing the matrix
for i in range(R):
for j in range(C):
print(matrix[i][j], end = "
")
print()
print("The element in 2nd row 3rd column is ",matrix[1][2])
OUTPUT