#include <stdio.h>
void non_working^swap (int a, int b){ printf("nws->(l) a=Xd, b=%d\n",a,b); int t«p=a; a=b;
b-tmp;
printf(”nws->(2) a=%d, b=%d n",a,b);
>
▼ void working^swap (int *a,int *b){ „ .. ..
printf("ws->(l) *a=Xd, łb=Xd, a=%p, b=%p\n ,*a,*b,a,b), int t«p=*a;
*a=*b;
*b=tmp; „
printf("ws->(2) *a=Xd, *b=Xd, a=%p, b=Xp\n ,*a,#b,a,b);
w int main(void){ int a,b;
printf("Podaj 2 liczby\n ); scanf("%d %d‘\&a,&b);
printf(”main->(l) a=%d, b=Xd, &a=%p, &b=%p\n",a,b,«a,&b); non_working_swap (a, b);
printf("main->(2) a=Xd, b=Xd, &a=%p, &b=Xp n",a.b.&a.&b);
working_swap (&a,&b);
31 printf("main->(3) a=Xd, b=Xd, &a=Xp, &b=Xp\n”,a,b,&a,&b);
32
33 r*tum 0;
IMacr 1 Kai I W5T WIEK C i»«pp c
1 i«i(f Do' Dfotuce *trh