The core idea of this is just to have a array of integers and change the value of them based on teminal inputs. This is my very first project and everything seems to be in order but it does not work, i cant seem to get any idea of what has gone wrong. I think it might have something to do with the array but i'm not sure. When i build it and then run it i get the the outputs from line 10, 11 and 12 but then when i input a number it just says: Process returned -1073741819 (0xC0000005)
#include<stdio.h>
#include<stdlib.h>
int main()
{
int account[1000];
// Tell you the options
printf("Check balance : 3\r\n");
printf("Add cash : 2\r\n");
printf("Remove cash : 1\r\n");
// Creates a variable for the loop
int q;
// Creates a "infinte loop"
for(q=0;q<100000;++q){
printf("Select Action\r\n");
int acted;
int am;
int acc;
scanf("%s", acted);
printf("Enter account number\r\n");
scanf("%s", acc);
// Checks what option you chose.
if (acted == 1) {
printf("Amount of cash to remove");
scanf("%s", am);
account[acc]=(account[acc]-am);
} else if(acted == 2) {
printf("Amount of cash to add");
scanf("%s", am);
account[acc]=(account[acc]+am);
} else if(acted == 3) {
printf("Account Number: ",acc);
printf("Balance of account: ",account[acc]);
};
}
}