0

I don't know why my compiler didn't like my for loop

#include <iostream>

using namespace std;

int main()
{
    cout<<"Please enter an integer.\n";
    int intege;

    cin>> intege;
    cin.ignore();
    cout<<"Please enter it again."

    for ( int inte = 1; inte = 1; ) {
        cin>> integ;

        if (intege==integ) {
        inte=0
        cout<<"Thank You, please hit enter to end the program."
        }
        else {
        inte=1
        cout
        }
    }
    return(1);
}
2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Stefano Mtangoo
0

I'm not quite sure what you meant by that, but apparently it was because I forgot a semicolon. Funny how it marks the next command as wrong.

Edited by ccube921: n/a

0

I'm not quite sure what you meant by that, but apparently it was because I forgot a semicolon. Funny how it marks the next command as wrong.

Because semicolon is a "punctuation mark". It sees two statements as one statement.
like I Love Tanzania It is most beautiful! (Two sentence but missing full stop)
The difference here is, you are more intelligent than a compiler

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.