Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int rodaUmaVez(int *a, int *b, int *c);
  5.  
  6. int rodaUmaVez(int *a, int *b, int *c) {
  7.     int aux, aux2;
  8.     aux = *a;
  9.     aux2 = *b;
  10.     *a = *c;
  11.     *b = aux;
  12.     *c = aux2;
  13. }
  14.  
  15. int main(void) {
  16.     int x, y, z;
  17.     printf ("Entre com 3 numeros: ");
  18.     scanf ("%d %d %d", &x, &y, &z);
  19.    
  20.     rodaUmaVez(&x, &y, &z);
  21.    
  22.     printf ("\n\nRodando os valores uma vez: %d, %d, %d", x,y,z);
  23.    
  24.     printf ("\n\n\n");
  25.     system("pause");
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement