View Single Post
Join Date: Dec 2007
Posts: 17
Reputation: cherryteresa is an unknown quantity at this point 
Solved Threads: 0
cherryteresa cherryteresa is offline Offline
Newbie Poster

Re: How to Sum a Pascal Triangle

 
0
  #5
Dec 4th, 2008
You're right, I was thinking about how all this math ties together. It's crazy to think about sometimes!

Okay, so thank you for pointing out the power thing. I think this is where I got stuck before. I'm trying to figure out how to raise something to the power. We didn't go over this in class and all the things I could find online showed it in printf form and not cout. And so I'm having trouble figuring out how to do it. I think basically what I need to do is:

for (int x=0; x<size; x++)
	{
		sum += pow (2, x); - // trying to figure 
                                               //  out how to 
                                               //translate this to code.
                                              // 2 to the x power

		for (int y=0; y<size; y++)
		{

		}
		cout<<sum<<"\n"<<endl;
	}
}

I'm going to keep searching.
Last edited by cherryteresa; Dec 4th, 2008 at 1:48 pm.
Reply With Quote