Practice problems solved in C++