samedi 16 janvier 2021

Can an if condition be a for loop?

Just wondering if the condition of an if statement can be a for loop in C++14. For example:

using namespace std;

if (for (int i = 0; i < 10; i++)){
    cout << "The number now is " << i << endl;
}

Aucun commentaire:

Enregistrer un commentaire