/*
Returns a random integer between 0 and N.
*/

#include <iostream>
#include <ctime>
using namespace std;
int main()
{
        int N;
        cout << "Enter a positive integer: ";
        cin >> N;
        if (N > 0)
        {
                srand(time(0));
                cout <<  rand() % (N + 1) << endl;
        }
        else
                cout << "The number has to be positive.\n";

        return 0;
}

