What would be the way of making this code shorter for Arduino C?

  pinMode(0, INPUT_PULLUP);
  pinMode(1, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);
  pinMode(9, INPUT_PULLUP);
  pinMode(10, INPUT_PULLUP);

Is there any way to tell the program that I want 10 pins to be granted an internal pull up resistor in one line of code?
To list all 10 pins as a comma separated list…

A first step would be to use a for loop

for (int pin = 0; pin < 11; pin++)
{
  pinMode(pin, INPUT_PULLUP);
}

I assume there are other ways of doing it by accessing the ports directly but the code won’t be so obvious.

A first step would be to use a for loop

Since the OP's list of pins is not continuous, some changes will be needed. Hint: an array of pin numbers.

How would I do that?
pinMode(n++, INPUT_PULLUP);

How would I do that?

How would you do what?

PaulS:

A first step would be to use a for loop

Since the OP’s list of pins is not continuous, some changes will be needed. Hint: an array of pin numbers.

Quite right. I had missed the fact that pin 2 was missing from the sequence.

byte myPins[] = {0,1,3,4,5,6,7,8,9,10};
for (int pin = 0; pin < 10; pin++)
{
  pinMode(myPins[pin], INPUT_PULLUP);
}

I had missed the fact that pin 2 was missing from the sequence.

I did too, until I noticed the first pin was 0 and the last was 10, and that OP said there were 10 pins. 0 to 10 is 11, so I had to pay attention.

Thanks. I forgot C syntax because I didn't use it in a long long time.