int squaring (int num) { int squared = 0; for (int i = 0; i < num; i++) { squared += num; } return squared; }
int sqauring (int num)- int squaring (int num)
- {
int times ;times = num ;int squared ;squared = 0;for (int i = 0 ; i <times ; i++ ){squared = squared + num ;}return squared ;- int squared = 0;
- for (int i = 0; i < num; i++)
- {
- squared += num;
- }
- return squared;
- }
// TODO: Replace examples and use TDD development by writing your own tests Describe(any_group_name_you_want) { It(should_do_something) { Assert::That(squaring(3), Equals(9)); Assert::That (squaring(4), Equals(16)); Assert::That(squaring(5), Equals(25)); Assert::That(squaring(-3), Equals(9)); } };
- // TODO: Replace examples and use TDD development by writing your own tests
- Describe(any_group_name_you_want)
- {
- It(should_do_something)
- {
Assert::That(3, Equals(9));Assert::That (4, Equals(16));Assert::That(5, Equals(25));- Assert::That(squaring(3), Equals(9));
- Assert::That (squaring(4), Equals(16));
- Assert::That(squaring(5), Equals(25));
- Assert::That(squaring(-3), Equals(9));
- }
- };