Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

need help in c++!! program to reverse pyramid of numbers

OpenStudy (anonymous):

#include <iostream> using namespace std; int main() { int rows,i,j,space; cout<<"Enter number of rows: "; cin>>rows; for(i=rows;i>=1;--i) { for(space=0;space<rows-i;++space) cout<<" "; for(j=i;j<=2*i-1;++j) cout<<"* "; for(j=0;j<i-1;++j) cout<<"* "; cout<<endl; } return 0; } Is that what your looking for?

OpenStudy (anonymous):

no i want the output as 4 5 6 2 3 1

OpenStudy (anonymous):

cn u help me?

OpenStudy (mandre):

So you want to turn 1 2 3 4 5 6 into 4 5 6 2 3 1? Is that the numbers you must work with or must your code allow entry of numbers? Do you need to reverse the numbers in arrays or for display only? If it's for display only it should be pretty simple.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!