Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Exercício 1: Troca de Valores
- Crie uma função que troque os valores de duas variáveis inteiras usando ponteiros.*/
- #include <stdio.h>
- void proced(int *refa,int *refb){
- *refa = 20;
- *refb = 80;
- }
- int main()
- {
- int a=10,b=40;
- int *p=&a,*q=&b;
- proced(p,q);
- printf("%d %d \n",a,b);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment