I'm new learner of C language,and I'm trying to make simple and basic ATM software on C.However, When I try to make password activation on that I face with problem with something which is when I try to enter password like ' hello ' it's not send it directly to else command . What should I do about it?
#include<stdio.h>
#include<conio.h>
#include<math.h>
int main () {
char pass;
int password = 9314;
int calculation;
int payment;
int balance = 4250 ;
printf("WELCOME TO C-BANK AUTOMATIC TELLER MACHINE");
getchar();
printf("\n\nGiving you the best service is our first purpuse.");
getchar();
printf("\n\nPlease enter your password=");
scanf("%d",&password);
if ( password == 9314 ) {
printf("Welcome again Mr.Piskin\n\nHow can we help for our dear customer");
printf("\n\n1-)Money extract");
printf("\n2-)Money payment");
printf("\n3-)Money Transfer");
printf("\n4-)Check your balance");
printf("\n5-)Extract your card");
printf("\n\nPlease select any options=");
scanf("%d",&calculation);
switch (calculation) {
case 1 :
printf("Enter amount of money you want to extract from your balance=");
scanf("%d",&payment);
balance -= payment;
if ( balance < 0 ) {
printf("\nWe are sorry about that we haven't been complated your processing");
getchar();
printf("\nPlease check your balance and try again later");
getch();
return 0;
}
printf("Calculation is over.Thank you for using our service");
getchar();
printf("Your rest balance is = %d",balance);
break;
case 2 :
printf("Enter amount of money you want to add to your balance=");
scanf("%d",&payment);
balance += payment;
printf("Calculation is over.Thank you for using our service");
getchar();
printf("Your new balance is = %d",balance);
break;
case 3 :
printf("Enter amount of money you want to transfer from your balance=");
scanf("%d",&payment);
balance -= payment;
if ( balance < 0 ) {
printf("\nWe are sorry about that we haven't been complated your processing");
getchar();
printf("\nPlease check your balance and try again later");
getch();
return 0;
}
printf("Calculation is over.Thank you for using our service");
getchar();
printf("Your new balance is = %d",balance);
break;
case 4 :
printf("This is your rest balance from your last account process=%d",balance);
break;
case 5 :
printf("Your card is extracted");
break;
default :
printf("Please try again");
break;
}
}
else {
printf("\n\nYour password is looking wrong.Please contact our security service");
printf(" immidiately");
printf("\nif you don't think that you weren't change the password");
getch();
return 0;
}
getch();
return 0;
}