Write a ‘C’ program to accept customer details such as: Account_no, Name and Balance in account .Assume maximum 20 customers in the bank. Write a function to print the account no & name of each customer with balance below Rs.100
#include<stdio.h>
#include<conio.h>
void main()
{
struct bank
{
int acc_no;
char name[20];
int bal;
}b[5];
int i;
clrscr();
for(i=0;i<5;i++)
{
printf(" \n\n enter the acc_no,name,balance\n\n");
printf("\nenter the account no\n");
scanf("%d",&b[i].acc_no);
printf("\n enter the name\n");
scanf("%s",b[i].name);
printf("\n enter the balance\n");
scanf("%d",&b[i].bal);
}
for(i=0;i<5;i++)
{
if(b[i].bal<100)
{
printf("\n---------------------------------------------\n");
printf("\n\n The acc_no,name,balance below RS:-100\n\n");
printf("\n the account no:-%d\n",b[i].acc_no);
printf("\n the name:-%s\n",b[i].name);
printf("\n the balance:-%d\n",b[i].bal);
}
}
getch();
}
#include<conio.h>
void main()
{
struct bank
{
int acc_no;
char name[20];
int bal;
}b[5];
int i;
clrscr();
for(i=0;i<5;i++)
{
printf(" \n\n enter the acc_no,name,balance\n\n");
printf("\nenter the account no\n");
scanf("%d",&b[i].acc_no);
printf("\n enter the name\n");
scanf("%s",b[i].name);
printf("\n enter the balance\n");
scanf("%d",&b[i].bal);
}
for(i=0;i<5;i++)
{
if(b[i].bal<100)
{
printf("\n---------------------------------------------\n");
printf("\n\n The acc_no,name,balance below RS:-100\n\n");
printf("\n the account no:-%d\n",b[i].acc_no);
printf("\n the name:-%s\n",b[i].name);
printf("\n the balance:-%d\n",b[i].bal);
}
}
getch();
}
Thank you for these programs you've written.. They're really very helpful..
ReplyDeleteCan you please help me with MENU DRIVEN PROGRAM for BANK ACCOUNT in C...
THANKS :)
PRASHAANTH :
ReplyDeletethis is very helpfull in doing my very 1st assignment in my college,, and got the good wishes from my proff, THANKS !!!!!!!!!
sorry PRASHAAANTH this program has one undefined reference to 'clrscr' can you help us to clear this b'cose is just like a problem to me, Plz help me i have assigment which told us to prepare a program like the example above........
Deletesir it is not in function
ReplyDeleteBHAI YE PROGRAM WORK NAHI KAR RAHA HAI
ReplyDeletenahi chlega header file mai string.h laga
Delete