Solution for ques 5

Please explain how to solve this one

Please send the question. I was not able to see the quiz.

The statement vector< vector< int > > matrix(100, vector (50, 100) ) declares :

  1. vector < int > (50, 100) declares a vector X of type int with 50 elements each initialized to 100 and matrix consists of 100 vectors of type int each equal to X. 2. The statement will result in a compile-time error. 3. vector (50, 100) declares a vector X of type int with 100 elements each initialized to 50 and matrix consists of 100 vectors of type int each equal to X. 4.The statement will result in a run-time error.

@aiman.mumtaz
Declares a 2D matrix of size 100*50 and each cell is initialised with value=100 i.e mat[I][j]=100 for all i in[0,100), and for all j in [0,50).

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.