why x=1,PW,; Had a error ? -_-

#include <conio.h>
#include <iostream>

using namespace std;

void balance ();
void withdraw ();
void deposit ();

int x=1,PW,;
char transaction;

main ()
{

start:
cout<<"Enter a Password:";
cin>>PW;

if (PW==143)
{

cout<<end1<<"[A] balance"<<end1<<"[B] withdraw"<<end1<<"[C] deposit"<<end1<<end1<<"choose transaction";
cin>>transaction;

if (transaction=='A')
balance();
else if (transaction=='B')
withdraw();
else if (transaction=='C')
deposit();
}
else
{
if (x!=3)
{
cout<<"Invalid Password!";
x=x+1
goto start;
}
else
{
cout<<"System Blocked!";
goto done;
}
}
done:
getch();

}
void balance ()
{
float a;

cout<<end1;
cout<<"Balance";
cout<<end1<<end1;
cout<<"Enter 1 for savings";
cout<<end1;
cout<<"Enter 2 for current";
cout<<end1<<end1;
cout<<"Choose transaction";
cin>>a;

if (a==1)
cout<<"Balance is p50000";
else if(a==2)
cout<<"Balance is p20000";
else
cout<<"Invalid Input";
}
void withdraw()
{
float c,y;
cout<<end1;
cout<<"withdrawal";
cout<<end1<<end1;
cout<<"Enter 1 to withdraw savings";
cout<<end1;
cout<<"Enter 2 to withdraw current";
cout<<end1;<<end1;
cout<<"Choose transaction";
cin>>c;

if (C==1)
{
cout<<"Enter amount to withdraw:";
cin>>y;
if (y<=50000)
cout<<"Remaining Balance is"<<50000-y;
else
cout<<"Insufficient Balance";
}
if (C==2)
{
cout<<"Enter Amount to withdraw";
cin>>y;
if (y<=20000)
cout<<"Remaining balance is"<<20000-y;
else
cout<<"insufficient balance ";
cin>>c;

}
}
void deposit ()
{ float x,y;
cout<<end1;
cout<<"deposit";
cout<<end1<<end1;
cout<<"Enter 1 for savings";
cout<<end1;
cout<<"Enter 2 for current";
cout<<end1<<end1;
cout<<"choose transaction";
cin>>x;

if (x==1)
{
cout<<"Enter amount to deposit";
cin>>y;
cout<<"New Balance is "<<50000+y;
}
else if (x==2)
cout<<"Enter amount to deposit";
cout<<end1;
cin>>y;
cout<<"New Balance is "<<20000+y;
}
1) Please use code tags when posting code, to make it readable:

http://www.cplusplus.com/articles/z13hAqkS/

2) We can't read your mind. If you have an error, tell us what it is. What possible reason could you have for not telling us?

2) In the line int x=1,PW,; you have a comma after PW.
cout<<end1<<"[A] balance"<<end1<<"[B] withdraw"<<end1<<"[C] deposit"<<end1<<end1<<"choose transaction";

[error] 'end1' was not declared in this scope
Last edited on
That's a letter 'l' not a number '1'. It's endline.
Topic archived. No new replies allowed.