Advertisement
shawonrog

01(reverse array)

Sep 17th, 2019
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include<stdio.h>
  2. int main () {
  3.  
  4. int array [100], sizeofArray;
  5.  
  6. printf("enter the size of array: ");
  7. scanf("%d", &sizeofArray);
  8.  
  9. for(int i=0;i<sizeofArray;i++) {
  10.  
  11.     scanf("%d", &array[i]);
  12. }
  13.    for(int i=sizeofArray-1;i>=0;i--) {
  14.     printf("%d\n",array[i]);
  15.  
  16.    }
  17.  
  18.    return 0;
  19.  
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement