Pascal's triangle using C++ vectors
The code seems all right; you might add the uniform variable initialization: int n_num {};. Furthermore, the way you read the number of rows is unstable, when you use std::cin to do it. Imagine you enter "b" instead of a number. Your program has no loop, that prevents that. You could use a function that only reads integers:

int readInt(std::istream&amp; stream) {
    /*
     * Function to get integers, that are entered by the user
     */
    int input;
    stream &gt;&gt; input;
    return input;
}


Then int num_n {readInt(std::cin)}; would be a possible way to do it.

Second off: why do you have the line else if (i % 2 == 0) ? I suppose you could just use else instead. If i % 2 == 1 returns false, it has to be 0. So there is no need to check again. It's like checking if your number is odd, and if it's not checking again if it's even.