#include
using namespace std;
#define MAX 20
main(void)
{
int loop;
int hold[MAX];
int counter = 0;
char more;
while(1){
cout << "enter a num" ;
cin >> hold[counter]; \\explain me this. Why was counter but in an array form[] ********************
cout << "\nENTER MORE NUM (Y,N)";
cin >> more;
if(more == 'n'){
break;
}else{
counter++;
}
}
for(loop = 0; loop <= counter; loop++){
cout << "element in" << counter+1 << " is " << hold[loop]; \\ why was loop in a array[] in hold.
}
system("PAUSE");
return(0);
}
2006-12-31
12:51:22
·
3 answers
·
asked by
Best Helper
4
in
Computers & Internet
➔ Programming & Design
cin >> hold[counter]; \\explain me this. Why was counter but in an array form[]
2. cout << "element in" << counter+1 << " is " << hold[loop]; \\why was loop put in a array form inside hold.
2006-12-31
12:52:30 ·
update #1