Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void swap(int *a, int *b);
- int main()
- {
- int *x, n, i;
- printf("How many numbers?\n");
- scanf("%d", &n);
- x = (int *)malloc(n*sizeof(int));
- for(i = 0; i < n; i++)
- scanf("%d", &x[i]);
- free(x);
- return 0;
- }
- void swap(int *a, int *b)
- {
- int temp = *a;
- *a = *b;
- *b = temp;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement