0
Can someone tell me to program for genrate this series
Write a program to generate this series 1 2 1 3 2 1 4 3 2 1 5 4 3 2 1 6 5 4 3 2 1
2 odpowiedzi
+ 7
#include <iostream>
using namespace std;
int main() {
int n;
cin>>n;
for(int i=1;i<=n;i++){
for (int j=i;j>0;j--){
cout<<j<<" ";
}
cout<<"\n";
}
return 0;
}
+ 1
give a try first!
if any query occurs then post that code here and ask for help
https://www.sololearn.com/Discuss/1316935/?ref=app