Hello there,i have given the task to make the atm machine using the c program..
my question is, why i got some error..I cant recognize such of that error...

/*intro*/

#include<stdio.h>
#include<conio.h>
#include<time.h>

int main()
{	printf("\n                      --UNIVERSITI TEKNOLOGI MALAYSIA--\n");
	printf("\n                      FACULTY OF ELECTRICAL ENGINEERING\n");
	printf("\n                                    1 SKEL 9\n");
	printf("********************************************************************************");
	printf("\n                     WELCOME TO GILA-GILA COMMERCE BANK\n");
	printf("\n********************************************************************************");
   printf("\n                                    BANK MEMBERS\n");
   printf("\n                   NURSYAHIDA IZZATI BT ZAKARIA      A11KE0133\n");
   printf("\n                   TEY SENG ROU                      A11KE0056\n");
   printf("\n                   THAVANETHEN A/L MUNUSAMY          A11KE0034\n");
   printf("\n                   VELTHERSON MOSES                  A11KE0112\n");
   printf("\n                   WAN MUHAMAD AMIN B WAN AB TALIB   A11KE0074\n");
   printf("\n                   YAASHEN PERIASAMY                 A11KE0085\n");
   getch();
   main:
	clrscr();
   int mainmenu, password;
   double a, m, n, o, p, q, r, balance;
   time_t td;
   int choice;
   FILE *stream;
   printf("                    WELCOME TO GILA-GILA COMMERCE BANK\n\n");
   printf("\n\n                1. VIEW ACCOUNT\n");
   printf("\n\n                2. CHECK BALANCE\n");
   printf("\n\n                3. WITHDRAW MONEY\n");
   printf("\n\n                4. PRINT STATEMENT\n");
   printf("\n\n                5. EXIT\n");
   printf("\n\n                                 PLEASE ENTER YOUR CHOSEN NUMBER:  ");
   scanf("%d", &mainmenu);
	clrscr();
   switch (mainmenu)
   {
      case 5:
      		O:	clrscr();
      		   printf("                    WELCOME TO GILA-GILA COMMERCE BANK\n\n");
            	printf("\n\n\n                    THANK YOU FOR USING GILA-GILA BANK");
         		getch();
         		return 0;
   	case 2:
        			printf("                    WELCOME TO GILA-GILA COMMERCE BANK\n\n");
      		B: printf("PLEASE ENTER YOUR PASSWORD:  ");
         		scanf("%d", &password);
         		clrscr();
					printf("                    WELCOME TO GILA-GILA COMMERCE BANK\n\n");
      			switch (password)
               {
         			case 110133:
            					stream = fopen("izzati.txt", "r+");
               				fscanf(stream, "%lf", &a);
                           balance=a-m;
                           a=balance;
               				printf("YOUR ACCOUNT BALANCE IS:  %.2lf", a);
               				break;
         		   case 110056:
            					stream = fopen("tey.txt", "r+");
              				   fscanf(stream, "%lf", &a);
                           balance=a-n;
                           a=balance;
               				printf("YOUR ACCOUNT BALANCE IS:  %.2lf", a);
               				break;
                  case 110034:
            					stream = fopen("nitden.txt", "r+");
               				fscanf(stream, "%lf", &a);
                           balance=a-o;
                           a=balance;
              				   printf("YOUR ACCOUNT BALANCE IS:  %.2lf", a);
            				   break;
            		case 110112:
            					stream = fopen("vel.txt", "r+");
               				fscanf(stream, "%lf", &a);
                           balance=a-p;
                           a=balance;
              				   printf("YOUR ACCOUNT BALANCE IS:  %.2lf", a);
           				      break;
         		   case 110074:
            					stream = fopen("amin.txt", "r+");
               				fscanf(stream, "%lf", &a);
                           balance=a-q;
                           a=balance;
              				   printf("YOUR ACCOUNT BALANCE IS:  %.2lf", a);
                           break;
          		   case 110085:
            					stream = fopen("yaashen.txt", "r+");
               				fscanf(stream, "&lf", &a);
                           balance=a-r;
                           a=balance;
               				printf("YOUR ACCOUNT BALANCE IS:  %.2lf", a);
               				break;
         			default:
        			 				goto B;
          		}
               printf("\n\n\nPROCEED?\t\t\tYES(1) / NO(2)");
            C: printf("\n\nPLEASE ENTER YOUR CHOICE: ");
          		scanf("%d", &choice);
          		if (choice==1)
          				goto main;
         	   else if (choice==2)
          				goto O;
                     else
                     	goto C;
      case 3:
      		   printf("                    WELCOME TO GILA-GILA COMMERCE BANK\n\n");
            D: printf("PLEASE ENTER YOUR PASSWORD:  ");
         		scanf("%d", &password);
               clrscr();
					printf("                    WELCOME TO GILA-GILA COMMERCE BANK\n\n");
      			switch (password)
               {
               	case 110133:
                  			stream = fopen("izzati.txt", "r+");
               				fscanf(stream, "%lf", &a);
               				printf(" WITHDRAW MONEY:  ");
               				scanf("%lf", &m);
               				balance=a-m;
                           a=balance;
               				fprintf(stream, "\n%.2lf", a);
               				printf("YOUR ACCOUNT BALANCE:  %.2lf", balance);
               				break;
                  case 110056:
                  			stream = fopen("tey.txt", "r+");
               				fscanf(stream, "%lf", &a);
               				printf(" WITHDRAW MONEY:  ");
               				scanf("%lf", &n);
               				balance=a-n;
                           a=balance;
               				fprintf(stream, "\n%.2lf", a);
               				printf("YOUR ACCOUNT BALANCE:  %.2lf", balance);
               				break;
               	case 110034:
                  			stream = fopen("nitden.txt", "r+");
               				fscanf(stream, "%lf", &a);
               				printf(" WITHDRAW MONEY:  ");
               				scanf("%lf", &o);
               				balance=a-o;
                           a=balance;
               				fprintf(stream, "\n%.2lf", a);
               				printf("YOUR ACCOUNT BALANCE:  %.2lf", balance);
               				break;
               	case 110112:
                  			stream = fopen("vel.txt", "r+");
               				fscanf(stream, "%lf", &a);
               				printf(" WITHDRAW MONEY:  ");
               				scanf("%lf", &p);
               				balance=a-p;
                           a=balance;
               				fprintf(stream, "\n%.2lf", a);
               				printf("YOUR ACCOUNT BALANCE:  %.2lf", balance);
               				break;
                  case 110074:
                  			stream = fopen("amin.txt", "r+");
               				fscanf(stream, "%lf", &a);
               				printf(" WITHDRAW MONEY:  ");
               				scanf("%lf", &q);
               				balance=a-q;
                           a=balance;
               				fprintf(stream, "\n%.2lf", a);
               				printf("YOUR ACCOUNT BALANCE:  %.2lf", balance);
               				break;

                  case 110085:
                  			stream = fopen("yaashen.txt", "r+");
               				fscanf(stream, "%lf", &a);
               				printf(" WITHDRAW MONEY:  ");
               				scanf("%lf", &r);
               				balance=a-r;
                           a=balance;
               				fprintf(stream, "\n%.2lf", a);
               				printf("YOUR ACCOUNT BALANCE:  %.2lf", balance);
               				break;
                  default:
                  			goto D;
               }
               printf("\n\n\nPROCEED?\t\t\tYES(1) / NO(2)");
            E: printf("\n\nPLEASE ENTER YOUR CHOICE: ");
          		scanf("%d", &choice);
          		if (choice==1)
          				goto main;
         	   else if (choice==2)
          				goto O;
                     else
                     	goto E;
      case 4: 	printf("                    WELCOME TO GILA-GILA COMMERCE BANK\n\n");
      		F: printf("PLEASE ENTER YOUR PASSWORD:  ");
            	time(&td);
         		scanf("%d", &password);
         		clrscr();
					printf("                    WELCOME TO GILA-GILA COMMERCE BANK\n\n");
      			switch (password)
               {
         			case 110133:
            					stream = fopen("izzati.txt", "r+");
               				fscanf(stream, "%lf", &a);
                           printf("\n\nTIME:  %s",asctime(localtime(&td)));
                           printf("\nACCOUNT HOLDER: NURSYAHIDA IZZATI BT ZAKARIA");
                           balance=a-m;
                           a=balance;
               				printf("\n\nACCOUNT BALANCE:  %.2lf", a);
                           break;
                  case 110056:
            					stream = fopen("tey.txt", "r+");
               				fscanf(stream, "%lf", &a);
                           printf("\n\nTIME:  %s",asctime(localtime(&td)));
                           printf("\nACCOUNT HOLDER: TEY SENG ROU");
                           balance=a-n;
                           a=balance;
               				printf("\n\nACCOUNT BALANCE:  %.2lf", a);
               				break;
                  case 110034:
            					stream = fopen("nitden.txt", "r+");
               				fscanf(stream, "%lf", &a);
                           printf("\n\nTIME:  %s",asctime(localtime(&td)));
                           printf("\nACCOUNT HOLDER: THAVANETHEN A/L MUNUSAMY");
                           balance=a-o;
                           a=balance;
               				printf("\n\nACCOUNT BALANCE:  %.2lf", a);
               				break;
                  case 110112:
            					stream = fopen("vel.txt", "r+");
               				fscanf(stream, "%lf", &a);
                           printf("\n\nTIME:  %s",asctime(localtime(&td)));
                           printf("\nACCOUNT HOLDER: VELTHERSON MOSES");
                           balance=a-p;
                           a=balance;
               				printf("\n\nACCOUNT BALANCE:  %.2lf", a);
               				break;
                  case 110074:
            					stream = fopen("amin.txt", "r+");
               				fscanf(stream, "%lf", &a);
                           printf("\n\nTIME:  %s",asctime(localtime(&td)));
                           printf("\nACCOUNT HOLDER:  WAN MUHAMAD AMIN B WAN AB TALIB");
                           balance=a-q;
                           a=balance;
               				printf("\n\nACCOUNT BALANCE:  %.2lf", a);
               				break;
                  case 110085:
            					stream = fopen("yaashen.txt", "r+");
               				fscanf(stream, "%lf", &a);
                           printf("\n\nTIME:  %s",asctime(localtime(&td)));
                           printf("\nACCOUNT HOLDER:  YAASHEN PERIASAMY");
                           balance=a-r;
                           a=balance;
               				printf("\n\nACCOUNT BALANCE:  %.2lf", a);
               				break;
                  default:
                  			goto F;


                }
               printf("\n\n\nPROCEED?\t\t\tYES(1) / NO(2)");
            G: printf("\n\nPLEASE ENTER YOUR CHOICE: ");
          		scanf("%d", &choice);
          		if (choice==1)
          				goto main;
         	   else if (choice==2)
          				goto O;
                     else
                     	goto G;


      case 1:
       			printf("                    WELCOME TO GILA-GILA COMMERCE BANK\n\n");
      		H: printf("PLEASE ENTER YOUR PASSWORD:  ");
            	time(&td);
         		scanf("%d", &password);
         		clrscr();
					printf("                    WELCOME TO GILA-GILA COMMERCE BANK\n\n");
      			switch (password)
               {
               	case 110133:
                        printf("\nACCOUNT HOLDER: \tNURSYAHIDA IZZATI BT ZAKARIA");
                        printf("\n\nIC NUMBER:\t\t920328026100");
                        printf("\n\nADDRESS:\t\tLOT 3351-2 ");
                        printf("\n\t\t\tKAMPUNG SUNGAI MERAH TENGAH");
                        printf("\n\t\t\t43000 KAJANG");
                        printf("\n\t\t\tSELANGOR");
                        printf("\n\nDATE CREATED:\t\t19/07/2011");
                        break;

                  case 110056:
                        printf("\nACCOUNT HOLDER: \tTEY SENG ROU");
                        printf("\n\nIC NUMBER:\t\t920801016742");
                        printf("\n\nADDRESS:\t\tLC453");
                        printf("\n\t\t\tTAMAN SENTOSA");
                        printf("\n\t\t\t84900 TANGKAK");
                        printf("\n\t\t\tJOHOR");
                        printf("\n\nDATE CREATED:\t\t10/10/2010");
                        break;

                  case 110034:
                        printf("\nACCOUNT HOLDER: \tTHAVANETHEN A/L MUNUSAMY");
                        printf("\n\nIC NUMBER:\t\t921204085391");
                        printf("\n\nADDRESS:\t\t13, JALAN BUNGA 3/6");
                        printf("\n\t\t\tTAMAN PERMATA");
                        printf("\n\t\t\t42000 KLANG");
                        printf("\n\t\t\tSELANGOR");
                        printf("\n\nDATE CREATED:\t\t28/02/2010");
                        break;

                  case 110112:
                        printf("\nACCOUNT HOLDER: \tVELTHERSON MOSES");
                        printf("\n\nIC NUMBER:\t\t920926125061");
                        printf("\n\nADDRESS:\t\tTAMAN SRI KINARUT");
                        printf("\n\t\t\tBLOK C4, LOT 260");
                        printf("\n\t\t\t89600 KINARUT PAPAR");
                        printf("\n\t\t\tSABAH");
                        printf("\n\nDATE CREATED:\t\t26/09/2009");
                        break;

                  case 110074:
                        printf("\nACCOUNT HOLDER: \tWAN MUHAMAD AMIN B WAN AB TALIB");
                        printf("\n\nIC NUMBER:\t\t920918036077");
                        printf("\n\nADDRESS:\t\tPT 6093");
                        printf("\n\t\t\tTAMAN BARAKAH");
                        printf("\n\t\t\t17500 TANAH MERAH");
                        printf("\n\t\t\tKELANTAN");
                        printf("\n\nDATE CREATED:\t\t09/06/2011");
                        break;

                  case 110085:
                        printf("\nACCOUNT HOLDER: \tYAASHEN PERIASAMY");
                        printf("\n\nIC NUMBER:\t\t910529145633");
                        printf("\n\nADDRESS:\t\t33, JALAN PRIMA 3/8");
                        printf("\n\t\t\tTAMAN PUCHONG PRIMA");
                        printf("\n\t\t\t47100 PUCHONG");
                        printf("\n\t\t\tSELANGOR");
                        printf("\n\nDATE CREATED:\t\t23/05/2008");
                        break;

                  default:
                  		goto H;
               }
               printf("\n\n\nPROCEED?\t\t\tYES(1) / NO(2)");
            I: printf("\n\nPLEASE ENTER YOUR CHOICE: ");
          		scanf("%d", &choice);
          		if (choice==1)
          				goto main;
         	   else if (choice==2)
          				goto O;
                     else
                     	goto I;
               getch();
   }
}

my question is, why i got some error..I cant recognize such of that error...

What's the error? :icon_rolleyes:

your code seems workable

Sorry for late reply..the error that I got is " 'clrscr' was not declared in this scope "...
I try looking at my code but cant figure it out..

Secondly, I got some notepad..that notepad stores some values...but i dont know where to put it..the compiler that i use is code:block
I'm very new to C programming so sorry...

the error that I got is " 'clrscr' was not declared in this scope "...

Your compiler doesn't support clrscr() in the conio.h library. This is precisely why we discourage it. However, since it's an unnecessary part of the program, you can remove all uses of clrscr().

Thank you very much :)..this code seems workable now..
By the way, I still cant figured it out the use/meaning of

FILE *stream

in c programming..
Kindly reply your explanation..

Look it up in your textbook.

Is this working now

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.