Hi im beginning in C++
just started liek 2 days ago and I need some help.
The code that posts below runs fine, as far as OPTION 1 is concerened (youll understand when u read far enough or compile the code yourself).

Option 1 is "change your password".
It asks you to enter your current password.
to continue u must enter in ur current password. Now, I am trying to build it so that if you enter the wrong current password, it will not let you pass and wiill ask you to enter your password again.
what happens is is that it still continues with the option that will ask you to enter a new password. I dont know why. Can someone help me with the code.

Plus, this is all jsut practice. with conditional statements for the most part.

Here is the code.
Code:
#include <iostream>
using namespace std;
main(){
     int a = 256781; //password
     int h = 24781; //pin number
     int current; //current password
     int newcurrent;//new current password
     int newcurrenta;//confirmation password
     int k;//second input of password (option 1)
     cout<<"Please enter your 6-digit password\n";
     cin>>a;
     cin.ignore();
     for ( a == 256781; a != 256781; ){
           cout<<"Incorrect Password. Please try again.\n";
          cin>>a;
                   }
     if (a=256781){
                  cout<<"You have correctly entered your password\n";
                  cout<<"Please type in your 4-digit pin to continue:\n";
                  cin>>h;
                  cin.ignore();
                  cout<<"\n";
                  cout<<"\n";
                               for ( h == 24781; h != 24781; ){
                                     cout<<"You have entered an incorrect pin. Please try again\n";
                                     cin>>h;
                                         }
                               if (h == 24781){
                                    
                                
                               
                                           cout<<"Welcome to your writers account\n";
                                           cout<<"What would you like to do?\n";
                                           cout<<"\n";
                                           cout<<"1 Change your password\n";
                                           cout<<"2 Create a new file\n";
                                           cout<<"3 Modify an existing file\n";
                                               int option; //option list
                                               cin>>option;
                                               cin.ignore();
                                              switch ( option ) {
                                                    case 1:
                                                           cout<<"Enter your current password\n";
                                                           cin>>k; 
                                                           cin.ignore();
                                                           for ( k = 256781; k != 256781;){
                                                               cout<<"The password you entered is incorrect\n";
                                                               cout<<"Please try again\n";
                                                               cin>>a;
                                                               cin.ignore();
                                                               }
                                                           if (k == 256781){
                                                               cout<<"Please enter a new password\n";
                                                               cin>>newcurrent;
                                                               cin.ignore();
                                                               cout<<"Please enter your password again\n";
                                                               cin>>newcurrenta;
                                                               cin.ignore();
                                                                            for ( newcurrent ==newcurrenta; newcurrent != newcurrenta; ){
                                                                                  cout<<"The password you entered was incorrect.\n";
                                                                                  cout<<"Please try again\n";
                                                                                  cin>>newcurrenta;
                                                                                  }
                                                                            if (newcurrent==newcurrenta){
                                                                                  cout<<"Congratulations. Your password has been changed\n";
                                                                                  cout<<"would you like to do anything else?";
                                                                                                          }             
                                                           
                                                           
  
                                                               break;
                                                     case 2:
                                                           cout<<"To create a new file, please enter a name for the file\n";
                                                           break;
                                                     case 3:
                                                            cout<<"Type in the name of the file to be modified\n";
                                                             break;

                                                             }
                                                            }
                                                          }
                  cin.get();
                  }
}