How would i create a small little program like this.
Enter a value N == > 3
your numbers are ==> 1 2 3
would you like to go again ? y/n == > Y
Enter a value N == > 6
your numbers are == > 1 2 3 4 5 6
would you like to go again? Y/N == > N
I'm very confused if i should use an array or just a sequence of numbers that add up by 1. I know how to the user loop though.
Can you write a loop where loop counter starts from 1, ends after N, and increases by one on each iteration?
you should use a loop (iterative control structure) for this problem, and this loop should be internal to the user loop itself
this is what I have so far.
// final.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <ctime>
using namespace std;
const unsigned int Array = 10;
// ==============================
int main() {
char GoAgain;
int C[Array];
int ii = 0;
do {
int A;
cout << "Enter a value ==> ";
cin >> A;
for (ii = 0; ii < Array; ii++) {
cout << "Your numbers are == > " << C[A] << endl;
}
for (ii = 0; ii = Array; ii++) {
cout << endl;
}
cout << "Hey Buddy! Want to go again? " << endl;
cin >> GoAgain;
} while (GoAgain == 'y' || GoAgain == 'Y');
return 0;
}//Function main()
I want the program to output what I wrote atth e beginning of the this topic