Format Integer in Arduino
The standard C function printf print to stdout. Arduino doesn't has a stdout. You can print to Serial, but must prepare/format the string first.

Instead of printf, use snprintf. It prints to a char array, which you later can use with Serial.print, or whatever other function that take a string.

void setup() {
  Serial.begin(9600);
  while(!Serial);

  char buffer[4];
  snprintf(buffer,sizeof(buffer), "%03d", 3);
  Serial.println(buffer);
}

void loop() {

}


Note: all the comments apply to this answers.