what is wrong in this codes?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nennahs24
    New Member
    • Feb 2010
    • 2

    what is wrong in this codes?

    this is the codes:


    Code:
    #include<stdio.h>
    #include<stdlib.h>
    int main()
    {
    char option,pin,transaction;
    int deposit, withdraw;
    option='0';
    
    
    
    printf("WELCOME TO SAMUEL'S BANK\n");
    printf("------------------------------\n\n");
    printf("Main Menu\n");
    printf("------------------------------\n");
    printf("1)Enter Pin #\n");
    printf("2)Exit\n");
    printf("------------------------------\n\n");
    scanf("%c", &option);
    
    
    
    
    
    
    {
    system ("cls");
    printf("Pin Number Verification\n");
    printf("------------------------------\n\n");
    printf("Please enter your pin number: ");
    scanf("%s", &pin);
    
    
    
    
    
    
    
    //if(inputfile ==NULL)
    {
    printf("Unable to open input file\n");
    }
    return 1;
    
    
    system ("cls"); 
    printf("Transactions\n");
    printf("------------------------------\n");
    printf("1)Deposit\n2)Withdraw\n3)Statement\n4)Exit \n");
    printf("------------------------------\n");
    scanf("%s",&transaction);
    }
    
    
    
    
    if (transaction =='1')
    
    {
    system ("cls");
    printf("Deposit\n");
    printf("------------------------------\n\n");
    printf("Please enter the amount of money you would like to deposit: ");
    scanf("%d", &deposit);
    }
    
    if (transaction =='2')
    
    {
    system ("cls");
    printf("Withdraw\n");
    printf("------------------------------\n\n");
    printf("Please enter the amount of money you would like to withdraw: ");
    scanf("%d", &withdraw);
    }
    
    if (transaction=='3')
    
    {
    system ("cls");
    printf("Statement\n");
    printf("------------------------------\n\n");
    }
    
    
    
    
    
    
    
    return 0;
    
    
    }




    when i will start to run it . the only mistake is this part:



    //if(inputfile ==NULL)



    that's the only mistake !!!
    please help me
    thanks !
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    It looks to me like most of those blank lines in your source listing should contain something, in many cases function headers I suspect and possibly some control structures.

    Where did you copy it from?

    Comment

    • nennahs24
      New Member
      • Feb 2010
      • 2

      #3
      i copy it here at bytes.com

      Comment

      • Banfa
        Recognized Expert Expert
        • Feb 2006
        • 9067

        #4
        In that case i suggest that you start again and write the code with the functionality that you want it to have rather than copying a half baked piece of code some somewhere else that you don't understand.

        Comment

        Working...