Question: So I have this exercise, I need to ask the user for 2 inputs (grades >0 <10) and then I have to print the average and then ask the user if they want to insert more grades 1-yes 2-no; if it's 1 then the program runs again, if it's 2 the program quits. But I'm having trouble to make the program quit.

```
// ConsoleApplication7.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include "stdafx.h"

int main()
{
    using namespace std;
    float n1;
    float n2;
    cin >> n1;
    cin >> n2;
    if ((n1 || n2) > 10) {
        cout << "Wrong grade";
    }
    else if ((n1 || n2) < 0) {
        cout << "Wrong grade";
    }
    else {
        cout << "The grade average is " << (n1 + n2) / 2 << endl;
        cout << "Do you want to insert more grades ? " << endl;
        int g;
        cin >> g;
        if (g = 1) {
            main();
        }
        else if (g = 2) {
            return 0;
        }
    }
    return 0;
}    

```

Answer: 
Your `if`condition is wrong:

```
if (g = 1)

```

sets `g` to 1, and is always true. What you want to do is:

```
if (g == 1)

```

And as Scott said in his comment, you shouldn't call main but rather use a `while` loop.
Please look at these modifications.

```
float n1;
float n2;
int g = 1;
while (g != 2)
{
    cout << "Please enter two grades: " << endl;
    cin >> n1;
    cin >> n2;
    if ((n1 || n2) > 10) {
        cout << "Wrong grade";
    }
    else if ((n1 || n2) < 0) {
        cout << "Wrong grade";
    }
    else {
        cout << "The grade average is " << (n1 + n2) / 2 << endl;
        cout << "Do you want to insert more grades ? " << endl;
        cin >> g;
    }
}
return 0;

```

}

Also note that I moved using namespace outside of main.