I made a simpler code
Post the code, using code tags.
What is your thinking here? Do you not realize that the integer divide will always give 0 as a result?
val = analogRead(A0);
volts = (val/1040);
Most people use statements similar to these:
val = analogRead(A0);
float volts = 5.0*val/1024.;