Skip to content

Instantly share code, notes, and snippets.

@maxoja
Last active July 17, 2018 14:50
Show Gist options
  • Save maxoja/381ef111f5bd8f2b9d588f43c65ebabc to your computer and use it in GitHub Desktop.
Save maxoja/381ef111f5bd8f2b9d588f43c65ebabc to your computer and use it in GitHub Desktop.
// ... includes
void scanFloat(float* f)
{
//scan a float value from console to the given address
}
void calculate(float r, float* perimeter, float* area)
{
//calculate the results based on the given r and put them into the specified addresses
}
int main()
{
float r;
//get input using function scanFloat(float* r)
float perimeter, area;
//generate results using function calculate(float r, float* perimeter, float* area)
printf("r=%f\nperimeter=%f\narea=%f\n", r, perimeter, area);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment