Prime numbers. this code is same as mentor told but it is not showing any output not in coding blocks IDE or any other. please help me here

#include

using namespace std;

int main() {

 int i;

int n, no;

cin >> n;

for (no = 2; no <= n; no++)

{

    for (i = 2; i < no; i++)

    {

        if (no % i == 0)

        {

            break;

        }

        if (i == no)

        {

            cout << no << ' ';

        }

    }

}

cout << endl;