Skip to content

Instantly share code, notes, and snippets.

@only-entertainment
Forked from anonymous/functions
Created September 20, 2012 21:08
Show Gist options
  • Save only-entertainment/3758360 to your computer and use it in GitHub Desktop.
Save only-entertainment/3758360 to your computer and use it in GitHub Desktop.
functions
#include <stdio.h>
int foo(int, int, int, int, int, int);
int main(int argc, char * argv[])
{
// Scoped to 'main'
int a, b, c = 0;
int x = 10;
int d, e = 0;
foo(a, b, c, x, d, e);
}
int foo(int aa, int bb, int cc, int xx, int dd, int ee)
{
// Parameters are scoped to 'foo'
printf("Number: %d %d %d\n", aa, bb, cc);
scanf("%d %d %d", &aa, &bb, &cc);
dd = xx + aa + bb + cc;
ee = dd/4;
printf("Your number is: %d\n ", ee);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment