Skip to content

Instantly share code, notes, and snippets.

@wmcnamara
Last active January 29, 2022 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wmcnamara/e8d332964c6eaa262a148db8f8a35739 to your computer and use it in GitHub Desktop.
Save wmcnamara/e8d332964c6eaa262a148db8f8a35739 to your computer and use it in GitHub Desktop.
Recursively counts from min to max
#include <iostream>
void countFrom(int min, int max)
{
if (min > max)
return;
std::cout << min << '\n';
countFrom(min + 1, max);
}
int main ()
{
countFrom(0, 10);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment