C++ password program issue. Syntax i think?
Hello peoples, I have made a program that is supposed to check a passcode and it the passcode is correct then it tells you so but if not it gives you another chance to try. It is very simple program because I am very new to C++. the code is below:
Code:
#include <iostream>
using namespace std;
int main(void)
{
bool loop = false;
int password = 2554;
int guess;
while(loop == false){
cout << "Please enter your passcode: ";
cin >> guess;
if(guess == password){
cout << "your passcode was correct thank you";
loop = true;
}
if(guess != password){
cout << "you passcode is incorrect, please try again";
}
}
return 0
}
This is the error message:
Code:
password.cpp:24:1: error: expected ‘;’ before ‘}’ token
I have tried many ways but I think its a sneaky syntax somewhere.