Battery charge level indicator

I want to make my arduino indicate charge of 9 v battery with help of 2 LEDs (red & green).
I have made a voltage divider.
I am not able to manage with the codes.

Measuring battery voltage is not really the same as measuring charge. Some type of battery hold their voltage up even though they are nearly fully discharged.

Without knowing your battery type we cannot advise you properly.

Have a look here for example: Discharge tests and capacity measurement of 9 volt transistor radio batteries at high current, 100mA to 500mA engineering data