#include<stdio.h> #include<math.h> #include<stdbool.h> void main() { int A[20] ; int B[20]; int i, j, n; printf("enter value n : "); scanf("%d", &n); for( i = 0; i < n; i++) { printf("A %d = ", i + 1); scanf("%d", &A[i]); } for (i = n-1, j = 0; i >= 0;i--, j++) { B[j] = A[i]; } printf("B = "); for (j = 0; j < n;j++) { printf(" %d", B[j]); } getch(); }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter