- 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

20th Oct 2017, 3:40 PM
Mr.Cool
Mr.Cool - avatar
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,
21st Oct 2017, 6:07 PM
Petr Hatina
Petr Hatina - avatar