creating a bank account structure program

 #include <stdio.h>

typedef struct bankaccount
{
int acnum;
char name[10];
char add[30];
}bank;

void display(bank a)
{
    printf("The account number is: %d\n",a.acnum);
    printf("The name of the account is: %s\n",a.name);
    printf("The address is: %s\n",a.add);
   
}
int main(){
bank a[3];
for(int i=0;i<3;i++)
{
printf("Enter the details for account %d\n",i+1);
printf("Enter the account number:\n ");
scanf("%d",&a[i].acnum);
printf("Enter the account name: ");
scanf("%s",a[i].name);
printf("Enter the account Address:\n ");
scanf("%s",a[i].add);


}

for(int i=0;i<3;i++)
{
 display(a[i]);
}


 return 0;
}

Comments