When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
7 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
is that a school assignment?
#include <iostream>
using namespace std;
const int data=10;
int main() {
int number;
int x[data];
for (int i=0;i<=data;i++){
cout << "Enter number here : ";
cin >> number;
cout << endl;
x[number] += 1;
}
for (int i=0;i<=data;i++){
cout << i << " : " << x[i] << endl;
}
}
I enter 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
and got
yes
you could ask your teacher where the input needs to come from in that case ^^
my teacher isnt avaliable rn
Thank you and let us know if you have any more questions!
This thread is now set to auto-hide after an hour of inactivity