[ create a new paste ] login | about

Link: http://codepad.org/6Sl3Qoro    [ raw code | output | fork ]

C, pasted on May 21:
#include <stdio.h>
void sorting(int *x, int *y, int *z) {
  int tmp;
  if (*x < *y) {
    tmp = *x;
    *x = *y;
    *y = tmp;
  }
  if (*x < *z) {
    tmp = *x;
    *x = *z;
    *z = tmp;
  }
  if (*y < *z) {
    tmp = *y;
    *y = *z;
    *z = tmp;
  }
}
#define N 100
int main () {
  int a, b, c;
  printf("a = "); scanf("%d", &a);
  printf("b = "); scanf("%d", &b);
  printf("c = "); scanf("%d", &c);
  sorting(&a, &b, &c);
  printf("a = %d, b = %d, c = %d\n", a, b, c);
  return 0;
}
/* end */


Output:
1
a = b = c = a = 1073830340, b = 134514176, c = 134513710


Create a new paste based on this one


Comments: