title: squaring a number in c++
body: <p>Okay so I am going through bjarn stroustrups book on c++ and one of his exercises asks me to calculate the square of a number without using the multiplication operator. so the boiler plate code that I started off with is a function called square of the type int with a parameter x of type int and the code block was return x*x; pretty simple. so I thought about it and I know I need a loop and I know it is probably a for loop. I know that I want the loop to sound something like this add x to x and loop this the value of x times. I am just starting out with c++ so I do not know how to create the loop. any ideas?</p>