Good Number

Description:

Write a simple c++ class to print the number of zeros in the given input no. if no zeros available in that number, it should print as "good number" otherwise it should print the no of zeros in the given no. Test Case 1 Input (stdin) 10000 Expected Output 4 Test Case 2 Input (stdin) 1000000 Expected Output 6

Program :

#include <iostream>

using namespace std;

int main()

{

int n,i=0;

  cin>>n;

  while(n>=10)

  {

    if(n%10==0)

  i++;

    n=n/10;

  }

  if(i>0)

  cout<<i;

  if(i==0)

    cout<<"good number";

return 0;

}