Answer to Question #3325 in C++ for mukunda

Question #3325
Write a program to print n umbers and enter a number where you wan to break the program.
1
Expert's answer
2011-07-11T10:06:45-0400
#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;
}

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