Skip to content

Commit

Permalink
C++ notes
Browse files Browse the repository at this point in the history
  • Loading branch information
AdithyakrishnaV committed Sep 23, 2021
1 parent c3416f6 commit bceb8ee
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions subarray.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <bits/stdc++.h>
using namespace std;

int main(){
int arr[]={1,2,3,4,5};
int n=5;

for(int start=0; start<n;start++){
for(int end=start; end<=n; end++){
for(int i=start; i<=end; i++){
cout<<arr[i]<<" ";
}
cout<<"\n";
}
}

return 0;
}

0 comments on commit bceb8ee

Please sign in to comment.