This program is designed to find and print common elements of two given arrays
Let constant DIM = (1e5+1) be maximum allowed size of the arrays. You can change it according to your need, but it must not exceed maximum allowed array size in C language.
To run code, paste it into any IDE and just click RUN.
After code started running, it will ask you to enter data: first line must contain natural number N < DIM second line must contain N integers (it will be array A, every A[i] must fit into int type in C language) third line must contain natural number M < DIM second line must contain M integers (it will be array B, every B[i] must fit into int type in C language)
code will answer with two lines: first line will contain number of common elements of arrays A and B second line will contain these numbers in non-decreasing order