Answer to Question #305367 in C for myles

Question #305367

write a program which produces the given sequence numbers.(in alternate arrangement) using the three looping statements



1
Expert's answer
2022-03-03T14:33:54-0500
#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
New on Blog
APPROVED BY CLIENTS