infern0 24 Light Poster
/*
Write a program that reads two integers num1 and num2 from the user, then displays the total of the all
of the numbers between num1 and num2 (inclusive). Your program should handle the following:
1. Make sure the numbers entered are between 0 and 100.
2. Make sure the second number is greater than or equal to the first number entered.
*/

I'm getting one error: illegal use of else without match if statement. I can't seem to figure out whats wrong? Can anyone help?

#include <iostream>
#include <string>
using namespace std;

int main ()
{
    int num1, num2;
    long sum = 0;
    cout << "Please enter an integer between 0 and 100: ";
    cin >> num1;
    if (num1 >= 0 && num1 <= 100)

        cout << "Please enter an integer between " << num1 << " and 100: ";
        cin >> num2;
        else cout << "Please read and follow the directions!";

    if (num2 >= num1 && num2 <=100)

        while (num2 >= num1)
        sum += num1++;
        else cout << "Please read and follow the directions!";

    cout << "The total of the integers between " << num1 << " and " << num2 << "is: " << sum;

}