Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int m, counter=0;
- cout << "How many numbers will you check: "<<endl;
- cin >> m;
- int* U;
- U = new int[m];
- for (int i = 0; i < m; i++) {
- cout << "Enter an element: "<<endl;
- cin >> U[m];
- if (U[m] == 0) {
- counter++;
- }
- }
- cout << "The number of 0-s in this array is: "<<counter;
- }
Advertisement
Add Comment
Please, Sign In to add comment