Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*CABEÇALHO
- Arquivo: LISTA 08 - Exercício 06.c
- Objetivo: Realiza a transposição de três valores.
- Autor(a): Ramon Borges.
- */
- #include <stdio.h>
- //PROTOTIPO DE FUNÇÕES
- void rodaUmaVez(int *x, int *y, int *z);
- int main()
- {
- int a, b, c;
- printf("Informe 3 valores inteiros: ");
- scanf("%d %d %d", &a, &b, &c);
- rodaUmaVez(&a,&b,&c);
- printf("%d %d %d", a, b, c);
- return 0;
- }
- void rodaUmaVez(int *x, int *y, int *z)
- {
- int aux;
- aux = *x;
- *x = *y;
- *y = *z;
- *z = aux;
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment