#include <iostream>
#include <cstdio>
usingnamespace std;
int main()
{
int A[100],B[100];
int i=0;
int j=0;
int x;
while(true)
{
cout << "please enter data,enter 999 to end ";
cin >> x;
if (x == 999)
\\is there a way to make it terminate with, for example 'q'?
break;
else
{
A[i]=x;
B[i]=2*x;
i++;
}
}
i--;
cout<<"your input your output\n";
for(j=0;j<=i;j++)
{
printf("%d\t\t\t%d\n",A[j],B[j]);
}
return (0);
}
The answer to that question is to adapt information from the above link. this may put severe limitations on the size and nature of the integers in the array.
You may have to go a step further and use string inputs and process those.