-
-
Save only-entertainment/3758360 to your computer and use it in GitHub Desktop.
functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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