Skip to content

Conversation

@syedashraf2211
Copy link

No description provided.

c=c+1;
}
}
if(c==2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove parenthesis from if

.parse::<u32>()
.unwrap();

let mut c=0;
Copy link
Collaborator

Choose a reason for hiding this comment

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

removed assigned 0. This value is replaced in Line 15.

replace with let mut c;

io::stdin()
.read_line(&mut num)
.expect("Error reading number");
let mut n = num.trim()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove mut.

mut is used to allow changing the value of variable. Do not use it unless required to change value dynamically in program after initialization.

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.

2 participants