You can take the result of a command and use it in another using either `backticks` or $(like this). I favour the $() syntax because it less likely to lead to a mistake (i.e. using the wrong type of quote), and is nestable.
The programs which will be run for a given runlevel are the ones with S at the start of the file name, so if you want to list the files which are executed, you can do it like this:
ls /etc/rc$(runlevel | cut -d" " -f2).d/S*