Skip to main content
0 online
theremin Jul 26, 2006

Ok. That's done with. Here's 2 others I need help with that I'm posting in the midst of trying to figure it out in the meantime. #1 an array called "alpha" with 50 components - type is double...

iwz Jul 26, 2006

what are you having trouble with on #1?

theremin Jul 28, 2006

Here's what I did (Doesn't work properly tho) #include #include using namespace std; int main(int argc, char *argv[]) { double alpha[50]; int index; for (index = 0; index < ...

yay yayOG 2004

First of all ^ does not do what you think it does, its an exclusive or logical operator, not power, you want to include cmath and use pow for that.

Second, I'd be amazed if you could even tell me in english what that code does. Any good compiler would complain that index at lines x y and z will never be 10, 20, 30, 40, or 50, a clue right there that your printing is notpart of your looping calculation.

First, do your calculations which looks like you want to square the index and store it into the first 25 elements, then multiples of 3 on the index for the remaining 25 (two seperate loops)

THEN, do your print out code, which we already gave you tips on in other comments

Welcome Back to eZabel

It's been a while. Here's what's new.

eZabel Lore

A complete history of our community — stats, Hall of Fame, legendary threads, and more.

View the Lore →

Everything Preserved

All 225,969 pieces of content from 2000–2014 are here — forums, messages, journals, photos, polls, and events.

💎

Gems

Spot something you love — a legendary comment, a classic thread, a great photo? Log in and click the diamond icon to mark it as a Gem. Add a note about why it's special. The best stuff surfaces on the Gems page.