Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int m=1, p=2;
- void fun1(int m){
- int x;
- x=m+p;
- printf("F1: m=%d, p=%d, x=%d \n", m, p, x);
- }
- int fun2(int x){
- int p;
- p=2*x-m;
- printf("F2: m=%d, p=%d, x=%d \n", m, p, x);
- return p;
- }
- int fun3(void){
- static int val = 5;
- return ++val;
- }
- int fun4(int *m){
- int x = *m;
- return ++(*m) + x;
- }
- int main(){
- int m=3, x=4;
- fun1(m);
- printf("M1: m=%d, p=%d, x=%d \n", m, p, x);
- m = fun2(x);
- printf("M2: m=%d, p=%d, x=%d \n", m, p, x);
- x = fun3();
- printf("M3: m=%d, p=%d, x=%d \n", m, p, x);
- p=fun3();
- x=fun4(&m);
- printf("M4: m=%d, p=%d, x=%d \n", m, p, x);
- return 0;
- }
Add Comment
Please, Sign In to add comment