From 8ec7cefa311b21de3e9df8c2b84f6214e87b377a Mon Sep 17 00:00:00 2001 From: amino19 Date: Wed, 26 May 2021 10:43:59 +0530 Subject: [PATCH] remove void & update comments --- math/finding_number_of_Digits_in_a_Number.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/math/finding_number_of_Digits_in_a_Number.cpp b/math/finding_number_of_Digits_in_a_Number.cpp index c0acd5c6a..0db8cb8c2 100644 --- a/math/finding_number_of_Digits_in_a_Number.cpp +++ b/math/finding_number_of_Digits_in_a_Number.cpp @@ -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