#include <stdio.h> int main() { int array[100], n, c, t, end; scanf("%d", &n); end = n - 1; for (c = 0; c < n; c++) { scanf("%d", &array[c]); } for (c = 0; c < n/2; c++) { t = array[c]; array[c] = array[end]; array[end] = t; end--; } printf("Reversed array elements are:\n"); for (c = 0; c < n; c++) { printf("%d\n", array[c]); } return 0; }
Hay friends .. AREA OF LANGUAGE IS TOO WIDE BUT NOW APPROXIMATE THEORY AND "C PROGRAMING CODES" ARE AVAILABLE . GOPAL KRISHNA "CHAUHAN"
Thursday, 20 September 2012
Reverse array by swapping(without using additional memory)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment