#include <stdio.h> #include <stdlib.h> int A = 3; int B = 4; void f1(int A, int B) { A++; B++; printf("%d %d\n",A,B); } void f2(int *B) { A = A - 1; *B = *B - 1; printf("%d %d\n",A,*B); } int f3(int B, int A) { int C; C = A + B; A = C - A; B = C - B; printf("%d %d %d\n",A,B,C); return C; } void f4(int *A, int *B) { int C; C = *A * *B; *A = C * C; *B = *A / C; printf("%d %d %d\n",*A,*B,C); } int f5(int C, int *D) { int A = 7; int B = 6; C = A + *D; A = B * C; *D = A + C; printf("%d %d %d %d\n",A,B,C,*D); return A; } void main() { int A; int B; A = 4; B = 3; f1(A,B); printf("%d %d\n",A,B); A = 4; B = 3; f1(B,A); printf("%d %d\n",A,B); A = 4; B = 3; f2(&B); printf("%d %d\n",A,B); A = 4; B = 3; f2(&A); printf("%d %d\n",A,B); A = 4; B = 3; A = f3(A,B); printf("%d %d\n",A,B); A = 4; B = 3; A = f3(B,A); printf("%d %d\n",A,B); A = 4; B = 3; B = f3(A,B); printf("%d %d\n",A,B); A = 4; B = 3; B = f3(B,A); printf("%d %d\n",A,B); A = 4; B = 3; f4(&A,&B); printf("%d %d\n",A,B); A = 4; B = 3; f4(&B,&A); printf("%d %d\n",A,B); A = 4; B = 3; f4(&A,&A); printf("%d %d\n",A,B); A = 4; B = 3; f4(&B,&B); printf("%d %d\n",A,B); A = 4; B = 3; A = f5(A,&B); printf("%d %d\n",A,B); A = 4; B = 3; B = f5(A,&B); printf("%d %d\n",A,B); A = 4; B = 3; A = f5(B,&A); printf("%d %d\n",A,B); A = 4; B = 3; B = f5(B,&A); printf("%d %d\n",A,B); A = 4; B = 3; A = f5(A,&A); printf("%d %d\n",A,B); A = 4; B = 3; B = f5(A,&A); printf("%d %d\n",A,B); A = 4; B = 3; A = f5(B,&B); printf("%d %d\n",A,B); A = 4; B = 3; B = f5(B,&B); printf("%d %d\n",A,B); }