Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infinity loop demonstration #76

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

infinity loop demonstration #76

wants to merge 6 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 25, 2019

No description provided.

println!("d={}",d);
let f = a+s+d;
println!("the sum is ={}",f);

Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. Please use loops to find sum of digits. The length of number can change and this program is hardcodded for exactly three digits
  2. It looks like similar program already exist in repository https://github.com/rustindia/Rust-for-undergrads/blob/master/src/algorithms_data_structures/simple_algorithms/sum_of_digits.rs


loop{
x += 5;
if x==100{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this if condition to make it infinite loop

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.

1 participant