ATM machine

Hi ..

can someone tell me about the error here :(

#include <iostream.h>
void main ()

float balance=0,value1,value2,account;
int telephone,choice=0,address,deposit=0,withdraw=0;
char name[10];

cout<<"Enter your account number"<<endl;

cout<<"Enter your name"<<endl;

cout<<"Enter your telephone number"<<endl;

cout<<"Enter your balance"<<endl;

cout<<"Enter your address"<<endl;

cout<<"Enter your choice [1]Deposit [2]withdraw [3]check balance other exit";

if(choice == 1)
cout << "How much money would you like to deposit?" << endl;
cin >> value1;
while(value1 >400.0)
cout << "You can only deposit in increments of 400 Rial" << endl;
cin >> value1;
balance = balance+value1;
if(choice == 2)
cout << "How much money would you like to withdraw?" << endl;
cin >> value2;
while(value2 >500.0)
cout << "You can only withdraw in increments of 500 Rial" << endl;
cin >> value2;
balance = balance-value2;
if (choice==3)

cout<<"Account no :"<<account<<endl;
cout<<"Name :"<<name<<endl;
cout<<"balance :"<<balance<<endl;


cout<<"Choice to exit-bye";

What isn't working correctly for you?

Unless you are using a very old compiler, you should be using #include <iostream> not <iostream.h>. If you are using one (such as Dev C++ or turbo) I suggest you upgrade to a more recent compiler like Visual Studio.

You should be using int main not void main and always return 0 at the end of your code so the program knows everything ended correctly.

Otherwise I don't see any obvious problems.
void main () should be int main () return 0; should be at the end of your program.

your post should be using code tags.

first, thank u for quick replay ^^
Yes, I know that is very old, but it is what our college teatch us:(
The problem is when i runing programe, and entir name,account no,etc . . Till
The statment "select choice 1 or 2 or 3 ... I cant enter the choice value ..
Last edited on
Topic archived. No new replies allowed.