eeprom problem

Hello,
for arduino uno i’m expecting output as 91083041 but getting 91017505 as output.if i’m removing EEPROM.write(addr,8); from program i’m getting correct output why this happen?

#include <EEPROM.h>
unsigned long int a;
int addr=0;
byte val;
void setup()
{
  Serial.begin(9600);
    EEPROM.write(addr, 1); addr++;
    EEPROM.write(addr, 4); addr++;
    EEPROM.write(addr, 0); addr++;
    EEPROM.write(addr, 3); addr++;
    
    EEPROM.write(addr, 8); addr++;
    EEPROM.write(addr, 0); addr++;
    EEPROM.write(addr, 1); addr++;
    EEPROM.write(addr, 9); addr++;
    
}
void loop()
{
  a=EEPROM.read(0)*1+EEPROM.read(1)*10+EEPROM.read(2)*100+EEPROM.read(3)*1000+EEPROM.read(4)*10000+EEPROM.read(5)*100000+EEPROM.read(6)*1000000+EEPROM.read(7)*10000000;
  Serial.println(a);
  delay(1000);
}
EEPROM.read(4)*10000

This is always giving problem.

Try making all the multiplies in you calculation into unsigned longs to force the calculation to return an unsigned long value

  a = EEPROM.read(0) * 1UL + EEPROM.read(1) * 10UL + EEPROM.read(2) * 100UL + EEPROM.read(3) * 1000UL + EEPROM.read(4) * 10000UL + EEPROM.read(5) * 100000UL + EEPROM.read(6) * 1000000UL + EEPROM.read(7) * 10000000UL;

Thank you so much

it is working fine now.
why this is so?

why this is so?

I think that without the type specifiers in the constants the calculation is done as if everything was an int despite you declaring a as an unsigned long. In practice you probably only need to make one of the constants an UL to force the result of the calculation to be an unsigned long.