n -> number of elements in the array
a[i] -> array to store numbers provided by the user
b[j] -> array to store the numbers divisible by 2
-
for(i=1;i<=j;i++)
-
cout<<b[j]<<"3";
-
"3" has no significance here.
To output the numbers divisible by 2, the variable used for index in the loop body should be 'i' instead of j.
Also, the 0th index is not used here. For an array a[20], the index ranges from 0 to 19. Using 20 as an index may work, but is not considered safe since that memory block is not occupied and can be allocated to others.