i got the error of (1)expected unqualified-id before 'volatile'

#include <TimerOne.h>
#include <avr/sleep.h>
#include <avr/interrupt.h>
#include <TimerOne.h>
#include <SoftwareSerial.h>

volatile float digitalValue;

void sleep()
{
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_enable();
}

void setup()
{
Serial.begin(9600);
pinMode(2,OUTPUT);
Timer.intialize(1000000);
Timer.attachInterrupt(ADC);

}

void loop()
{

set_sleep_mode(SLEEP_MODE_PWR_DOWN)
noInterrupts();
sleep_enable();
sleep_cpu();

interrupts();
sleep_disable();
}

void ADC()
{
if(A0 != 0)
pinMode(A0,INPUT);
float digitalValue;
float sensorPin=A0;
digitalValue = analogRead(sensorPin);
Serial.print("digital value = ");
Serial.println(digitalValue);
delay(1000);
else

}

Are you sure that you have posted the correct code ?

The errors that I get are to do with the fact that the Timer object has not been declared along with the fact that the ADC() function has no return type and this

  Serial.println(digitalValue);        
  delay(1000);
  else

is surely wrong too

You've got two variables called digitalValue.

Please remember to use code tags when posting code

  if(A0 != 0)

There is no Arduino for which A0 is defined as 0.