Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
static void printTo100(int step) {
System.out.println(step);
int failsAt100 = 1/ (100 - step);
printTo100(step+1);
} -
AllenII16177y@danielspaniol. I was thinking recursion was the obvious solution myself
Never said it couldn't crash 😂😂😂 -
Wack61957y@danielspaniol I'd additionally wrap it in a `try { ... } catch(Exception e) {}` block.
-
void printnum(uint max)
{
If (max > 0)
printnum(max-1);
cout << max << endl;
}
And call a printnum(100); -
AllenII16177y@CodaKairos ERR: requirement not met
Requirement 'no conditions' violated by 'if' keyword -
@CodaKairos there is still a condition in there. A shortend one but still not right ;)
-
Wack61957y`X ? Y : Z` is just a short form for `if (X) { Y } else { Z }` so again, there's a condition.
-
AllenII16177y@Jop- what they said, concerning the ternary.
Correct, for taking the requirement literally 😂😂 -
watzon45887y
Related Rants
Master Coder Unlocked!
undefined
hardcore
programming
hack
coder