Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

For loop

Status
Not open for further replies.

Stjuice

Programmer
Joined
Aug 22, 2001
Messages
4
Location
US
I was wondering if anyone could help me with a question I had. I was wondering how I would start a program that outputs the "12 Days of Christmas" song using a switch structure or a for loop?
 
Code:
const char* days[12] = 
{  "Partridge in a pear tree",
   "day 2","day 3" etc...
};

for(int i = 0;i<12;i++)
{
   cout<<days[i]<<endl;
}

You can expand upon it but that is the gist of it.

Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top