Skip to content

Conversation

@phnsh
Copy link
Owner

@phnsh phnsh commented Jun 11, 2019

Week 2, assignment 1.

}

static int recursion(int num) {
if(num > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using the terminating condition to add a terminating return type for the function. It will remove the necessity for the product variable.

if(num > 0) {
temp3 = temp1 + temp2;
temp1 = temp2;
temp2 = temp3;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary variables used. Again, consider using the terminating condition to your benefit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants