/!\Help in this prog. please /!\

Discussion in 'Homework Help' started by !!Miss.EE!!, May 22, 2008.

Thread Status:
Not open for further replies.
  1. !!Miss.EE!!

    Thread Starter Active Member

    Oct 17, 2007
    38
    0
    Hi all ,

    I have a project in C language ,

    I've done every thing , and it gives me 0 error

    However, I want to check if it works , My part depends on my friend part ,

    put I've put here structure and initialized them , but still it didn't work ,
    can any one help me please ~~~~~~~~~~~~~~~~~~~

    this is my work:::

    Quote:
    #include<stdio.h>

    struct personal_info /* Employee Personal Data Structure */
    {
    char employee_name[20];
    char gender;
    char status;
    int ID;
    int DOB;
    int month;
    int day;
    int year;
    int Joining_Date;
    int month1;
    int day1;
    int year1;
    int children;
    int D_code;
    int N_code;
    long int Account_Nbr;
    }personal[1];



    struct departments{

    int Dcode;
    char Name[20];

    }dept[1]={"123","ee"};



    struct nationalities{

    int Ncode;
    char name[20];

    }nation[1]={"321","uae"};

    int main ()
    {
    int i,j,k;

    //struct departments dept.Dcade={"123"};
    //struct departments dept.Name={"EE"};

    //struct nationalities nation.Ncode={"321"};
    //struct nationalities nation.name={"uae"};


    printf( "\t\t\t%s\n\n\n","P a y r o l l S y s t e m" );
    printf( "\t\t\t %s\n","Employee Personal Data" );
    printf( "\t\t\t ______________________\n");

    for(i=0;i<1;i++){

    printf("\nEmployee ID :");
    scanf("%d",&personal.ID);

    printf("\nEmployee Name:");
    scanf("%s",&personal.employee_name);

    printf("\t\t\t\tGender (F/M):");
    scanf("%s",&personal.gender);

    printf("\nDate of birth:");
    scanf("%d%*c%d%*c%d",&personal.month,&personal.day,&personal.year);

    printf("\t\t\t\tjoining date:");
    scanf("%d%*c%d%*c%d",&personal.month1,&personal.day1,&personal.year1);

    printf("\nMarital Status (Single/Maried):");
    scanf("%s",&personal.status);

    printf("\t\tNo.of children: ");
    scanf("%s",&personal.children);

    printf("\nDepartment code:");
    scanf("%d",&personal.D_code);



    for(j=0;j<1;j++){ /*Department Name Search*/

    if(dept[j].Dcode==personal.D_code){

    printf(" Department Name : %s",dept[j].Name);

    break;
    }
    }

    printf("\nNationality code:");
    scanf("%d",&personal.N_code);


    for(k=0;k<1;k++){ /* Natinality Search*/

    if(nation[k].Ncode==personal.N_code){

    printf(" Nationality Name: %s",nation[k].name);

    break;
    }
    }

    printf("\nBank Account No :");
    scanf("%ld",&personal.Account_Nbr);

    printf("\n\n");

    }
    return 0;



    REGARDS
     
  2. Dave

    Retired Moderator

    Nov 17, 2003
    6,960
    145
    Please do not post multiple threads asking the same question. Answers to the active thread.

    Dave
     
Loading...
Thread Status:
Not open for further replies.