mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-05-07 22:32:28 +08:00
remove void & update comments
This commit is contained in:
@@ -3,12 +3,15 @@
|
||||
* @file [Program to count digits in an
|
||||
* integer](https://www.geeksforgeeks.org/program-count-digits-integer-3-different-methods)
|
||||
*
|
||||
* \brief Finding number of Digits in a Number
|
||||
* \details It is a very basic math of finding
|
||||
* @brief Finding number of Digits in a Number
|
||||
* @details It is a very basic math of finding
|
||||
* number of digits in a given number i.e, we
|
||||
* can use it by inputting values whether it
|
||||
* can be a positive/negatie value, lets say
|
||||
* can be a positive/negative value, lets say
|
||||
* integer.
|
||||
* There is also second method to do it with,
|
||||
* by using "K = floor(log10(N) + 1)", but its
|
||||
* only applicable for numbers (not integers).
|
||||
* For more details, refer Algorithms-Explanation
|
||||
*/
|
||||
|
||||
@@ -19,10 +22,13 @@
|
||||
* @brief Main function
|
||||
* @returns 0 on exit
|
||||
*/
|
||||
int main(void) {
|
||||
int main() {
|
||||
/* Initialize 'n' & 'count' by 0 */
|
||||
int n = 0;
|
||||
int count = 0;
|
||||
/* 'cout' to ask input from user..
|
||||
* 'cin' to taking integer as input..
|
||||
*/
|
||||
std::cout << "Enter an integer: ";
|
||||
std::cin >> n;
|
||||
/* iterate until n becomes 0
|
||||
|
||||
Reference in New Issue
Block a user