Advertisement
Guest User

Untitled

a guest
Oct 8th, 2015
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.67 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.   /*variable1 = 20;
  7.   variable2 = 40;
  8.  
  9.   aux = variable1;
  10.   variable1 = variable2;
  11.   variable2 = aux;*/
  12.  
  13.   int a, b, aux, suma, resta, division, mult;
  14.  
  15.   printf("Ingresar numero 1: ");
  16.   scanf("%d", &a);
  17.  
  18.   printf("Ingresar numero 2: ");
  19.   scanf("%d", &b);
  20.  
  21.   printf("El valor de la variable 2 cambio a %d y el valor de la variable 1 es %d", a, b);
  22.  
  23.   aux = a;
  24.   a = b;
  25.   b = aux;
  26.  
  27.   suma = a + b;
  28.   resta = a - b;
  29.   division = a / b;
  30.   mult = a * b;
  31.  
  32.   printf(" Suma: %d\n Resta: %d\n Division: %d\n Multiplicacion: %d\n", suma, resta, division, mult);
  33.  
  34.   system("PAUSE");
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement