Easy C++ Question on WS2812B LED Strip

Sorry if this has been asked before. I've been searching and couldn't find my answer.

I have a WS2812B Led strip with 30 LEDs. I want 1 - 10 to be Green, 2 - 20 Red, and 3 - 30 Yellow.
I was try to do something like this...

for(int i = 0; i < 10; i++)
for(int k = 0; 20 > k > 10; k++)
for(int j = 0; j > 20; i++)

Can you tell me how to define these integers? Thank you

I want 1 - 10 to be Green, 2 - 20 Red, and 3 - 30 Yellow.

?? they overlap?

do you mean:

for (int i = 0 ; i < 10 ; i++)     // zero through nine
{
}
for (int i = 10 ; i < 20 ;  i++) // ten through nineteen
{
{
for (int  = 20;  i < 30 ; i++)  // twenty through  twenty-nine
{
}

you can use the same "i" counter variable because they hold their scope during the for loop only...

Yeah, I think that is what I wanted and no, I didn't want them over lapping. Its been a long time since I'vs done any programming. I've been trying to find good refresher tutorials, but this should hold me over until I do.

Thanks

great.

define your ledPins in an array, for example. Note that you need not start on the zero pin as the first pin is assigned the zero position in the array.

const int led [30] = {
  3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32};  // you must have a Mega!

//
void setup() 
{                
  for (int i = 0; i < 30; i++)
  {
    pinMode(led[i], OUTPUT);    
  }

  for (int i = 0 ; i < 10 ; i++)     // zero through nine
  {
    digitalWrite(led[i], HIGH);
  }
  for (int i = 10 ; i < 20 ;  i++) // ten through nineteen
  {
    digitalWrite(led[i], HIGH);
  }
  for (int i = 20;  i < 30 ; i++)  // twenty through  twenty-nine
  {
    digitalWrite(led[i], HIGH);
  }
}
//
void loop() 
{

}

Ok, This is what I have and it still isn't working. It says "name lookup of "i" changed for new ISO 'for' scoping"

Any other suggestions?

#include "FastLED.h"
#define NUM_LEDS 30
#define datapin 4
CRGB ledsA[NUM_LEDS];

void setup(){
LEDS.setBrightness(255);
LEDS.addLeds<WS2812B, datapin, GRB>(ledsA, NUM_LEDS);
// memset(ledsA, 0, NUM_LEDS * sizeof(struct CRGB));
}

void loop() {

for (int i = 0 ; i < 10 ; i++);// zero through nine
ledsA = CRGB::Blue;
{
}
for (int i = 10 ; i < 20 ; i++); // ten through nineteen
ledsA = CRGB::Lime;
{
{
for (int i = 20; i < 30 ; i++); // twenty through twenty-nine
ledsA = CRGB::Yellow;
{
}
Thank you

Ok, I got it! Thanks for your help!
Here it is in case anyone stumbles across this thread while looking for help.

#include "FastLED.h"
#define NUM_LEDS 30
#define datapin  4
CRGB ledsA[NUM_LEDS];


void setup(){
  LEDS.setBrightness(255);
  LEDS.addLeds<WS2812B, datapin, GRB>(ledsA, NUM_LEDS);
 // memset(ledsA, 0,  NUM_LEDS * sizeof(struct CRGB)); 
}

//const int led [30] = {
 // 3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32};  // you must have a Mega!

//
void loop() 
{                
  for (int i = 0; i < 30; i++)
  {
    //pinMode(led[i], OUTPUT);    
  }

  for (int i = 0 ; i < 10 ; i++)     // zero through nine
  {
    ledsA[i] = CRGB::Blue;
  }
  for (int i = 10 ; i < 20 ;  i++) // ten through nineteen
  {
    ledsA[i] = CRGB::Purple;
  }
  for (int i = 20;  i < 30 ; i++)  // twenty through  twenty-nine
  {
    ledsA[i] = CRGB::Red;
    FastLED.show();
    //digitalWrite(led[i], HIGH);
  }
}
//
//void loop()