Skip to content

Instantly share code, notes, and snippets.

@RyanBreaker
Last active March 13, 2016 20:36
Show Gist options
  • Save RyanBreaker/501129e88fe368db2536 to your computer and use it in GitHub Desktop.
Save RyanBreaker/501129e88fe368db2536 to your computer and use it in GitHub Desktop.
#include <stdio.h>
void PrintShampooInstructions(int numCycles) {
if (numCycles < 1) {
printf("Too few.\n");
return;
}
if (numCycles > 4) {
printf("Too many.\n");
return;
}
for(int i = 1; i <= numCycles; i++) {
printf("%d: Lather and rinse.\n", i);
}
printf("Done.\n");
}
int main(void) {
PrintShampooInstructions(2);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment