Structure
Bank details
#include<stdio.h>
struct bank
{
int acno;
float money;
char name[10];
};
void main()
{
struct bank a[3];
int i;
for(i=1;i<=3;i++)
{
printf("enter ac number \n");
scanf("%d",&a[i].acno);
printf("enter amount of ac no :%d\n",a[i].acno);
scanf("%f",&a[i].money);
printf("enter name of ac no :%d\n",a[i].acno);
scanf("%s",&a[i].name);
}
for(i=1;i<=3;i++)
display(a[i]);
}
display(struct bank a)
{
printf("ac number money name\n");
printf(" %d %.2f %s\n",a.acno,a.money,a.name);
}
struct bank
{
int acno;
float money;
char name[10];
};
void main()
{
struct bank a[3];
int i;
for(i=1;i<=3;i++)
{
printf("enter ac number \n");
scanf("%d",&a[i].acno);
printf("enter amount of ac no :%d\n",a[i].acno);
scanf("%f",&a[i].money);
printf("enter name of ac no :%d\n",a[i].acno);
scanf("%s",&a[i].name);
}
for(i=1;i<=3;i++)
display(a[i]);
}
display(struct bank a)
{
printf("ac number money name\n");
printf(" %d %.2f %s\n",a.acno,a.money,a.name);
}
Comments
Post a Comment