Sample output:
Please enter a number(Less than 8 digits):
1203021
how can I sure only 8 digits key in and how to count the zero inside the given number. Please teach me final is coming :(

use a for loop,to loop through the individual numbers and make a count variable which increases each time you hit a 0

The same question had been asked on C++ forum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.