Lautaroleguizamon

Intercambio en main

Aug 18th, 2023
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int a, b;
  7. puts("Ingrese los valores a intercambiar:");
  8. scanf("%d",&a);
  9. scanf("%d",&b);
  10.  
  11. printf("Los valores sin intercambiar son: a=%d b=%d\n", a, b);
  12. int atemp = a;
  13. a=b;
  14. b=atemp;
  15.  
  16. printf("Los valores ahora son: a=%d b=%d", a, b);
  17. return 0;
  18. }
  19.  
Add Comment
Please, Sign In to add comment