Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Favorite Colors | Array Fundamentals
C# Arrays

bookChallenge: Favorite Colors

Task

Swipe to start coding

Practice working with arrays by defining and displaying your favorite colors.

  • Create a new array called favoriteColors and initialize it with five color names of your choice.
  • Loop through each element in the favoriteColors array.
  • Print each color to the console on a separate line.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 2
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookChallenge: Favorite Colors

Swipe to show menu

Task

Swipe to start coding

Practice working with arrays by defining and displaying your favorite colors.

  • Create a new array called favoriteColors and initialize it with five color names of your choice.
  • Loop through each element in the favoriteColors array.
  • Print each color to the console on a separate line.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 2
single

single

some-alt