Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.30 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     int arr[100],top;
  5.  
  6.     int n,i;
  7.     scanf("%d",&n);
  8.  
  9.     ///push
  10.     for(i=0;i<n;++i){
  11.         scanf("%d",&arr[i]);
  12.         top=i;
  13.     }
  14.     top++;
  15.     arr[top]=55;
  16.  
  17.     printf("%d\n",arr[top]);
  18.  
  19.     ///pop
  20.  
  21.     top--;
  22.     printf("%d",arr[top]);
  23.  
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement