Skip to content

Instantly share code, notes, and snippets.

@maxoja
Last active July 17, 2018 14:55
Show Gist options
  • Save maxoja/57aaa957e41d48428b03111c036da035 to your computer and use it in GitHub Desktop.
Save maxoja/57aaa957e41d48428b03111c036da035 to your computer and use it in GitHub Desktop.
// .. includes
void scanValues(int* a, int* b)
{
//use scanf to get 2 input integers into address a and b
}
void conditionalSwap(int* a, int* b)
{
//swap the values if the value in a is bigger than b's
}
void printResult(int* a, int* b)
{
//print the value at address a and b
}
int main()
{
int a,b;
//get inputs
scanValues(???, ???);
//swap a, b
conditionedSwap(???, ???);
//print the result
printResult(???, ???);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment