WAP to create a dynamic array of user desired size and search an element in that array

WAP to create a dynamic array of user desired size and search an element in that array.

How to solve using function?

You can do
int *a = new int(n)
and do binary search.

1 Like