Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #define max 10
- /* run this program using the console pauser or add your own getch, system("pause") or input loop */
- int main() {
- int a[max] ;
- int *i, *j;
- int k, n, temp;
- printf("n= ");
- scanf("%d", &n);
- for(k=0;k<n;k++){
- scanf("%d, ",&a[k]);
- }
- i=a;
- j=a+n-1;
- while( i < j) {
- temp = *i;
- *(i++) = *j;
- *(j++) = temp;
- }
- for(k=0;k<n;k++){
- printf("%d, ", a[k]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement