Hello, I am creating a program that's supposed to take input from the user in the form below and output it in a certain style and this involves storing the variables from all the test cases in order to output them at the same time:
Input:
2 //number of test cases(how many the entire program will be repeated)
4 //array size
1 2 3 4 //array elements
3 //element to be searched for
5 //again, array size
10 90 20 30 40 //array elements
40 //element to be searched for
Output:
2 4 //the indexes of both the number found in the 1st test case and the 2nd number found in the 2nd test case:
My output is this:
Number of test cases:
2
Array size
4
1 2 3 4
Element to search for:
3
Index: 2
Array size
5
10 90 20 30 40
Element to search for:
40
Index: 4