/*Write a function Zero that will take a number as a parameter and return the number of zeroes and the number of remaining digit | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

/*Write a function Zero that will take a number as a parameter and return the number of zeroes and the number of remaining digit

#include <iostream> using namespace std; void Zero(int num, int* zero, int* NonZero) { zero = 0; NonZero = 0; while (num != 0) { int k = num % 10; if (k == 0) { zero++; } if (k != 0) { NonZero++; } num = num / 10; } } int main() { int number, Zeroes, OtherNumbers; cout << "Enter the given number: "; cin >> number; cout << endl; Zero(number, &Zeroes, &OtherNumbers); cout << "Total number of zeroes in " << number << " are " << Zeroes << " .\nTotal Non Zeroes are " << OtherNumbers << " .\n"; system("pause"); return 0; } Kindly tell me where is the issue as I am new to c++

27th Dec 2020, 4:32 PM
Chaudhary Haroon Ali
Chaudhary Haroon Ali - avatar
0 Answers