Answer to Question #58225 in C++ for bong

Question #58225
Write a program which produces the given sequence nos. (in alternate arrangement ) using the three looping statements:
1,5,2,4,3,3,4,2,5,1
1
Expert's answer
2016-03-18T15:48:04-0400
#include <iostream>

using namespace std;

int main()
{
cout << 1 << "," << 5;
for (int i = 2, j = 4; i < 6; i++, j--)
{
cout <<","<< i << "," << j;
}
cout << "\n";
system("pause");
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS