Question #3325

Write a program to print n umbers and enter a number where you wan to break the program.

Expert's answer

#include <iostream>
using namespace std;

int main()
{
const int N = 5;
int arr[N] = { 10, 46, 37, 8, 19 };

cout << "N numbers: ";
for (int i = 0; i < N; ++i)
& cout << arr[i] << " ";
cout << endl;

int where_to_break = -1;
cout << "Please enter a number where you want to break the program:" << endl;
cin >> where_to_break;

return 0;
}

LATEST TUTORIALS
APPROVED BY CLIENTS