12-22-2014, 06:48 PM
Can someone please give me the solution for below general programming question,
How to print the number of occurrences of each number presnt in a matrix.
For examble:
x =
22 23 23 23
23 24 25 22
22 23 23 25
for the above matrix, it should print like below,
How to print the number of occurrences of each number presnt in a matrix.
For examble:
x =
22 23 23 23
23 24 25 22
22 23 23 25
for the above matrix, it should print like below,
Code:
"Number 22 occurred 3 time"
"Number 23 occurred 6 time"
"Number 24 occurred 1 time"
"Number 25 occurred 2 time"