Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- #define N 5
- void inverse (int *p,int n)
- {
- int i,temp;
- for (i = 0;i<n/2;i++)
- {
- temp = p[i];
- p[i]= p[(n-1) -i ];
- p[(n-1)-i] = temp;
- }
- }
- void main()
- {
- int i;
- int x[N] = {14,18,12,10,99};
- inverse (x,N);
- for (i=0;i<N;i++)
- printf ("x[%d] = %d \n",i,x[i]);
- }
Advertisement
Add Comment
Please, Sign In to add comment