BTW: Regarding the error where the compiler was complaining about not being able to find iostream, #include <iostream>
may just need to be put at the top of your list of #includes.
Although that said, <stdlib> and <conio> are old C headers, they don't exist in C++ (well, they do, but not as <stdlib> or <conio> as I'll explain shortly!).
The very fact that the compiler is complaining that <iostream> cannot be found and at the same time isn't complaining about <stdlib> and <conio> not being found; leads me to believe that you may have set up a C project in Code::Blocks rather than a C++ project, which could also explain your problems! Are you 100% sure that you're working with a C++ project in C::B??
To check, you could try using the new project wizard in C::B to create a new C++ console project and then either paste your code in the generated main.cpp (but don't forget to qualify std::cout as outlined in my previous post!) or paste one of the snippets from my previous post into main.cpp and see how you get on.
If you do need to use any of the old C functions in stdlib and/or conio in a C++ project you'd typically need to use:
#include <cstdlib> // correct C++ header for the C stdlib.h
#include <conio.h> // uses the old C header, but requires .h at the end!
Also you should be aware that stdlib (or cstdlib) and conio …