I recently started learning c++ basics and now getting familiar with "while" concept. I working on a code that will validate users pin code.Could some one tell me why is it happening?
#include<iostream>
using namespace std;
void Main()
{
int pinUzytkownika=4567,pin,errorlicznik = 0;
do{
cout<<"PIN: ";
cin >> pin;
if(pin != pinUzytkownika)
{
errorlicznik++;
}
}while(errorlicznik<3 && pin!=pinUzytkownika);
if(errorlicznik < 3)
cout<<"Loading..";
else
cout<<"Blocked";
}