Who can find solution for this problem?

Create a structure called account wit data member acc no., ac type n balance. Now write a program to store record of 20 acc in a file named customer.txt den display only those acc no. wit blc less than 500

this is all i could do...the struct is not written in the txt file... there must be some mistake...
and actually the second output printing is to be done by reading the values from the txt file..but i have directly printed it..