a variable disappears for an unknown reason

#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#define I 27
#define IR 25
#define File "test.txt"

struct customer
{
    long long identity;
    char iban[I];
    int money;
};

void filesave(struct customer cus)
{
    FILE *file;
    file = fopen(File,"a");
    if (file==NULL)
    {
        printf("the file did not open properly.");
    }

    fprintf(file,"%lld %s %d n",cus.identity,cus.iban,cus.money);

    fclose(file);
}

int identitycontrol(long long identity)
{
     int a=0,bas;
    long long i=1;
    while (a<11)
    {
        bas=(identity/i)%10;
        if (bas<0 || bas>9)
        {
            return 0;
        }
        
        i*=10;
        a++;
    }
    if (identity / i > 0 && identity>0) {
        return 0;
    }
    return 1;
}

int ibancontrol(char iban[I])
{
     if(!isalpha(iban[0]) || !isalpha(iban[1]))
     {
        return 0;
     }
     
    for (int i = 2; i < I; i++)
    {
        if (iban[i]<48 || iban[i]>57)
        {
            return 0;
        }
        
    }
    return 1;
}

int moneycontrol(int money)
{
    if (money>0)
    {
        return 1;
    }
    return 0;
}

int transfermoneycontrol(int b, int m)
{
    if(b>=m)
        return 1;
     else
        return 0;
}

int moneyorder(char account1[],char account2[],int transfermoney)
{
    FILE *file;
    file = fopen(File,"r");
    struct customer cus[100];
    char temp[100];
    int y=0,s=0;
    while ( fgets(temp,100, file) != NULL )
    {
            sscanf(temp,"%lld %s %d",&cus[s].identity,cus[s].iban,&cus[s].money);
    
        // printf("%d",strlen(cus[s].iban));
        if(strcmp(cus[s].iban,account1)==0)
        {
                cus[s].money -=transfermoney;  
                y++;

        }
        if(strcmp(cus[s].iban,account2)==0)
        {
            cus[s].money +=transfermoney;
            y++;
        }
        s++;
    }    
        printf("%sn",account1);
        printf("%sn",cus[0].iban);

     for(int z=0;z<s;z++)
    {
        printf("nGuncel bilgiler:n");
        printf("%d: %s  %lld  %d n",z+1,cus[z].iban,cus[z].identity,cus[z].money);
    }
    
    fclose(file);

    

   
    
    file = fopen(File, "w");
    if (file == NULL)
    {
        printf("the file did not open properly.");
        return 0;
    }
    
    for (int x = 0; x < s; x++)
    {
       filesave(cus[x]);
    }
    fclose(file);
    return  1;
}

int main()
{
    int choice=0,control=0;
    struct customer cus;
    char account1[I];
    char account2[I];
    int transfermoney;
   
    
    while (1)
    { 

    printf("-----Menü-----n");
    printf("1:Entryn");
    printf("2:Transfern");
    printf("3:Exitn");

    printf("What is your choice: ");
    scanf("%d",&choice); 
    fflush(stdin);
    switch (choice)
    {
    case 1:
        while (1)
        {   
                printf("Please enter your identity: ");
                scanf("%lld",&cus.identity);
                fflush(stdin);
                if (identitycontrol(cus.identity)==1)
                {
                    
                break;
                }   
        }
        while (1)
        {
                printf("Please enter your iban: ");
                scanf("%s",cus.iban);
                //fgets(cus.iban,I,stdin);
                //cus.iban[strlen(cus.iban)-1]='';                
                fflush(stdin);
                if (ibancontrol(cus.iban)==1)
                {
                    
                    break;
                }
        }
        
        while (1)
        {
                printf("Please enter your money: ");

                scanf("%d",&cus.money);
                fflush(stdin);
                if (moneycontrol(cus.money)==1)
                {
                    break;
                }    
        }     
                filesave(cus);
        break;
        case 2 :
        while(1)
        {
                printf("Please enter the main account we will send money to: ");
                fflush(stdin);
              //  fgets(account1,I,stdin);
               // account1[strlen(account1)-1]='';
                scanf("%30s",account1);
              fflush(stdin);
            // getchar();
               if (ibancontrol(account1)==1)
               {
                   break;
               }
                      
        }
        while(1)
        {
                printf("Please enter the account from which you will receive money: ");
                //fgets(account2,I,stdin);  
                scanf("%30s",account2);
               fflush(stdin);
             //getchar();
                if (ibancontrol(account2)==1)
                { 
                    break;
                }  
        }        
        
       while(1)
        {
                printf("Please enter your transfer money: ");
                scanf("%d",&transfermoney);
                fflush(stdin);
                if (moneycontrol(transfermoney)==1)
                {
                   break;
                }          
        }
                
                int a=moneyorder(account1,account2,transfermoney);
            if (a==1)
            {
                printf("Money order sucsessful.n");
            }
            else if (a==0)
            {
                printf("Money order unsucsessful.n");
            }
            


            
            break;
        case 3:
                exit(2);
        break;
    default:
                printf("Wrong choice!!n");
        break;
    }
   
}
 return 0;



}

After getting the account1 variable, I can print it, but when it enters the world containing account 2, account1 disappears, but I don’t know why.All the remaining functions and file operations are working, but there is a problem in that part.account1 disappears, I cannot press it in a way that I do not understand or the function. When I send it, it’s empty inside, just n

New contributor

Morpen is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật