Skip to main content
remove extra line
Source Link
cbojar
  • 4.3k
  • 1
  • 19
  • 19

You could do something like:

int number;
while((number = solicitNumber()) != 0) {
    print("Error!");
    number = getInput();
}

...

int solicitNumber() {
    print("Enter number");
    return getInput();
}

You could do something like:

int number;
while((number = solicitNumber()) != 0) {
    print("Error!");
    number = getInput();
}

...

int solicitNumber() {
    print("Enter number");
    return getInput();
}

You could do something like:

int number;
while((number = solicitNumber()) != 0) {
    print("Error!");
}

...

int solicitNumber() {
    print("Enter number");
    return getInput();
}
Source Link
cbojar
  • 4.3k
  • 1
  • 19
  • 19

You could do something like:

int number;
while((number = solicitNumber()) != 0) {
    print("Error!");
    number = getInput();
}

...

int solicitNumber() {
    print("Enter number");
    return getInput();
}