Finding odd and even digits from an integer
Try to avoid using using namespace std.
&lt;cmath&gt; is not utilized anywhere, so just remove it unless you end up adding associated code.
Avoid giving variables single-letter names (unless they're simple loop counters, which is okay to do).  Although it may save some typing, it will instead make them appear meaningless as there is no context.  Comments can be added, but they're not a good substitute for actual variable names.  If a variable needs a comment, chances are it hasn't been given a good name.
To help increase readability and maintainability:


Have one variable per line.  This also helps in case comments need to be added.

long a;
long s=0;
long s1=0;

Separate operators and operands with whitespace so that the two can be identified.

long a;
long s = 0;
long s1 = 0;

Separate code lines based on purpose, also so that readers can focus on certain parts.

cout&lt;&lt;" Odd numbers ranged array"&lt;&lt;endl;

for(i=0; i&lt;n; i++)
    cout&lt;&lt;d[i]&lt;&lt;" ";

cout&lt;&lt;endl;

Keep variables as close in scope as possible instead of listed together.  This could also help determine if a variable is no longer being used.

cout &lt;&lt; "Write a number: " &lt;&lt; endl;
long a; // move this here
cin &gt;&gt; a;


std::endl also flushes the stream, which is slower.  If you want just a newline, use "\n":

cout &lt;&lt; "Write a number: \n";

This:

c=nl[i];
nl[i]=nl[j];
nl[j]=c;


can be done more concisely with std::swap:

std::swap(n1[i], n1[j]);

Consider making this program more modular (using functions).  Keeping everything in main() could make it hard for yourself and others to read and maintain the code.  It is also not clear, just from looking at it, that this program is written to fulfill those five tasks.  It could just be one task if the reader weren't otherwise aware of them.

This can be done any way you'd like, but the most likely solution could be to have one function for each of those tasks (while giving them appropriate names).  They could then be called from main(), and you could also get the user input from main() (this could, for instance, allow you to terminate the program right away if invalid input is given).