Ask your own question, for FREE!
Computer Science 7 Online
OpenStudy (anonymous):

please help i dont know was going on i want the user to enter his\her own number but it does not do so. #include #include using namespace std; //int arraysum(int [],int); int main() { int n[10]; int arraysize=0; //n[10]=arraysize; cout<<"plz enter elemests "; //cin>>arraysize; cin>>n[10]; for(int i=0;i<10;i++) cout<

OpenStudy (divanshu):

u need to apply a loop for taking the value from user , i hope u are talking about the cell number , so the program is : int main() { int n[10]; cout<<"plz enter elements "; for(int i=0; i<10; i++) { cin>>n[i]; } //now to print the elements for(int i=0;i<10;i++) { cout<<n[i]; //add endl if you need the elements 2 be in different lines return 0; }

OpenStudy (divanshu):

by the way, post the full question with ur doubt , so that any1 can help u in better way?

OpenStudy (rsmith6559):

One other thing to watch out for in your code is that an array of 10 elements (n[10]), are actually zero indexed. You have elements n[0] thru n[9]. You don't have an element n[10], and that's not checked for, except by your code in C or C++.

OpenStudy (divanshu):

my code is totally right, i have used <n[10] not = n[10]

OpenStudy (rsmith6559):

Your's is, REMAINDER's, not so much, and we're supposed to be helping him/her.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!