so i did a array and enter to him numbers with money and i have only 50 . so when i open 1 and put the number their everything ok but if i want to do that again i cant. i mean to press O again
when i press E i out from the program
help?
Code:
#include <stdio.h>
int main()
{
char x;
double a[50][2];
int count=0;
printf("please enter your Transaction type\n");
scanf(" %c",&x);
do{
switch(x)
{
int j;
double y;
int i;
case 'O':
for(i=0;i<50;i++)
{
for(j=1;j<2;j++)
{
if(a[i][j]==1){
count++;}
}
}
if(count<50)
{
for(i=0;i<50;i++)
{
for(j=1;j<2;j++)
{
if(a[i][j]!=1) {
printf("please enter your Initial deposit?\n");
scanf("%lf",&y);
a[i][j-1]=y;
a[i][j]=1;
printf("you number bank is %d and your balance is %.2lf \n",i+901,a[i][j-1]); }
break;
}
break;
}
}
else{ printf("the bank are full\n");}
break;
case 'E': continue;
break;
default: printf("wrong enter try again\n");
break;
}
printf("please enter again your Transaction type selection\n");
scanf(" %c",&x);
}
while(x!='E');
printf("thank you bye bye\n");
}