Our Even Numbers code in C++.
Even Numbers Class Header File:
#pragma once
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
class EvenNumbers {
public:
    EvenNumbers(unsigned, unsigned);
    virtual ~EvenNumbers();
    string prepResult();
private:
    unsigned int start; // Our starting point
    unsigned int stop; // where we will stop
    string result; // Store result here.
    stringstream aux; // helps us convert int to string
};Even Numbers Class File:
#include "stdafx.h"
#include "EvenNumbers.h"
/**
* Our constructor.
* @param first - for the start value
* @param last - for the end value
*/
EvenNumbers::EvenNumbers(unsigned first, unsigned last) {
    start = first;
    stop = last;
    aux << first;
    result = "Even numbers between " + aux.str();
    aux.str(""); // clear 'aux'
    aux << last;
    result += " and " + aux.str() + " are: \n";
    aux.str("");
}
/**
* nitty gritty
* @return - list of the required even numbers.
*/
string EvenNumbers::prepResult() {
    /*
    * Loop from start to stop and rip out odd numbers;
    */
    while (start <= stop) {
        if ((start % 2) == 0) { // modulo(%) is explained below
            aux << start;
            result = result + aux.str() + "; ";
            aux.str("");
        }
        start = start + 1; // increase start by 1
    }
    return result;
}
EvenNumbers::~EvenNumbers() {
}Main Class:
// Arithmetic.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "EvenNumbers.h"
#include <iostream>
using namespace std;
int main() {
    try {
        cout << "\n    Welcome to our demonstration sequels\n";
        cout << "Hope you enjoy (and follow) the lessons.\n\n";
        unsigned int start = 1, stop = 100;
        /*
        * Use the Even Number class.
        */
        EvenNumbers e_list(start, stop);
        cout << e_list.prepResult() << "\n";
    }    catch (exception& e) {
        cout << "\n" << e.what() << "\n";
    }
    return 0;
}  Try it out!
                            
                                
                                
                                
                                Elegance (0.0)
                                
                                
                                
                            
                        
                
        
            
            
        