'x' does not name a type

x = 13
void setup(){
  pinMode(x, OUTPUT);
}
void loop(){
  digitalWrite(x, HIGH);
  delay(100);
  digitalWrite(x, LOW);
  delay(100);
}

The error i am getting is

exit status 1
'x' does not name a type

This is how a variable declaration looks:

byte x = 13;

You must declare the type of the variable.

The type determines how much memory is assigned to the variable, and thus how large/small a number it can hold. The type also determines whether the variable can hold negative numbers (signed types) or only positive numbers (unsigned types).

In the case of a variable that will store a pin number, the use of the unsigned 8 bit byte type is a good choice because there are no negative pin numbers. A byte can hold numbers up to 255 and there are no Arduino boards that have more than than many pins.

All C++ statements must end in a semicolon.

You can find more information on types here:
https://www.arduino.cc/reference/en/

Thank you so much it works out well....

I'm glad to hear it's working now. Enjoy!
Per

In general you should use more meaningful names for your variables and constants. It appears that you are using the name ‘x’ to mean “The pin number of the built-in LED”. (Note: The Arduino IDE already provides a name: LED_BUILTIN.)

void setup()
{
  pinMode(LED_BUILTIN, OUTPUT);
}


void loop()
{
  digitalWrite(LED_BUILTIN, HIGH);
  delay(100);
  digitalWrite(LED_BUILTIN, LOW);
  delay(100);
}

If you wanted to blink an LED that you wire to a DIFFERENT pin it would be good to use a name that includes the terms LED and Pin, like:

const byte LEDPin = 5;


void setup()
{
  pinMode(LEDPin, OUTPUT);
}


void loop()
{
  digitalWrite(LEDPin, HIGH);
  delay(100);
  digitalWrite(LEDPin, LOW);
  delay(100);
}

If you are blinking multiple LEDs of different colors, you should add the color name to make it clear which is which:

const byte RedLEDPin = 5;
const byte GreenLEDPin = 7;

void setup()
{
  pinMode(RedLEDPin, OUTPUT);
  pinMode(GreenLEDPin, OUTPUT);
}

void loop()
{
  digitalWrite(RedLEDPin, HIGH);
  delay(100);
  digitalWrite(GreenLEDPin, HIGH);
  delay(100);
  digitalWrite(GreenLEDPin, LOW);
  delay(100);
  digitalWrite(RedLEDPin, LOW);
  delay(100);
}

Once you get up to three or more pins that you want to treat similarly, it’s time to learn about arrays and loops:

const byte RedLEDPin = 5;
const byte GreenLEDPin = 7;
const byte BlueLEDPin = 3;


const byte LED_COUNT = 3;
const byte LEDPins[LED_COUNT] = {RedLEDPin, GreenLEDPin, BlueLEDPin};

void setup()
{
  for (int i = 0; i < LED_COUNT; i++)
  {
    pinMode(LEDPins[i], OUTPUT);
  }
}


void loop()
{
  // Light up each in turn
  for (int i = 0; i < LED_COUNT; i++)
  {
    digitalWrite(LEDPins[i], HIGH);
    delay(100);
  }


  // Turn off each in reverse order
  for (int i = LED_COUNT-1; i >= 0; i--)
  {
    digitalWrite(LEDPins[i], LOW);
    delay(100);
  }
}

Now, if you want to add more LEDs to the sequence you only need to change the value of LED_COUNT and add the new pin name to the array. If you want to change the order in which the LEDs light up you just have to change the order in which you put them in the array. Nothing else has to change.