Testcase 1 is giving run error

testcase 1 is giving run error after exchanging the arr declaration and cin statement…why??please explain in detail .

and if this is wrong then why is the other test case giving correct result???

@Ignitor hey kartik you didn’t share your implementation.so how can I verify for the cause.

Actually sir my both testcases run fine untill i exchange the positions of the statements (which i mentioned in my description )

@Ignitor hey kartik please share your code through ide.codingblocks.com