- 1
plz write a source code for this program
WAP to generate the pattern 5 9 12 14 15 4 8 11 13 3 7 10 2 6 1
1 Answer
0
#include <iostream>
using namespace std;
int main() {
int n=5;
for (int i=n;i>0;i--)
{int sum=i, t=4;
for (int j=+0;j<i;j++)
{cout<<sum<<" ";sum+=t--;}
cout <<endl;
}
return 0;
}
//It would be enough,