Measuring 32V using ADC of Atmega8
Your calculation for the battery voltage is wrong. Assuming adcReading varies from 0 to 1023, it should look like this:

batteryVoltage = (adcReading * 30) / 1023


Note though that denoting voltage like this, with integer volts, will only give you 31 possible readings (0 to 30). A more useful result might be in millivolts:

batteryVoltageMillivolts = (adcReading * 30000) / 1023


Note that in this case batteryVoltageMillivolts will have to be a long, not an int.