| closed account (4y79216C) | |
|
hello everyone can someone help me about array plsss i really need help right now using one-dimensional array. create a program that will count the number of the same intries in a series number based on the user specific no. to count EXPECTED output Enter no.1:2 Enter no.2:1 Enter no.3:1 Enter no4:2 what number to v=count?1 total number 1 is 2 should use a counter i appretiate those who will answer | |
|
|
|
| kbw (5517) | |
|
Duplicate post: http://www.cplusplus.com/forum/general/87973/ | |
|
|
|
| closed account (4y79216C) | |
|
this is my code #include<iostream> using namespace std; int main() { int n,hn,nc; int i; int count; float totaln; count=0; cout<<"ENTER MANY NUMBERS TO INPUT?:"<<endl; cin>>hn; for(i=1;i<=hn;i++) { cout<<"ENTER NUMBER :"<<i<<":"; cin>>n;} cout<<"WHAT NUMBER TO COUNT:"<<endl; cin>>nc ; count=0; totaln+=n; cout<<"THE TOTAL NUMBER IS:"<<totaln; system("PAUSE"); } | |
|
|
|
| bobdabilder (76) | |||
I'm trying to understand what you're doing. maybe this will help?
| |||
|
|
|||
| closed account (4y79216C) | |
|
the counter was not include but thanks for the codes but when i enter it like this for example ENTER MANY NUMBERS TO INPUT:2 ENTER NUMBER1:5 ENTER NUMBER2:6 WHAT NUMBER TO COUNT:1 instead of 0, it became the total number is 1 hmmmm i wonder why?? | |
|
|
|
| Imadatobanisa (647) | |
|
Now can you explain your program step-by-step? (especially WHAT NUMBER TO COUNT) Up to now you haven't given us all necessary information yet... And, we have no idea what your program should be. | |
|
|
|
| closed account (4y79216C) | |||
|
Enter how many numbers?: 4 Enter no.1: 2 Enter no.2: 1 Enter no.3: 1 Enter no4: 2 what number to v=count?:1 // u will enter total number 1 is: 2 // the number 1 is been add
| |||
|
|
|||
| EssGeEich (1007) | |
|
Another duplicate: http://www.cplusplus.com/forum/windows/88167/ | |
|
|
|
| closed account (4y79216C) | |
| near to finish | |
|
|
|