diff --git a/Code.html b/Code.html new file mode 100644 index 0000000..a0583ee --- /dev/null +++ b/Code.html @@ -0,0 +1,83 @@ + + + + Code page + + + +
+

Welcome to Coding Page..

+
+
+

Counts the digits in a number..

+
+

Python code for given problem statement

+ +
+
+            // Python program to count the digits in a number 
+            def count_digits(n):
+              n = str(n)
+              return len(n)
+ 
+ 
+            # Driver code
+            n = 456533457776
+            print(count_digits(n))
+
+        
+
+
+
+

Sample Inputs and Outputs...

+ +
+            Input : 12345
+            Output: Total No Of Words: 5
+        
+
+ + +
+            Input : 5342
+            Output: Total No Of Words: 4
+        
+
+ + +
+            Input : 42345221
+            Output: Total No Of Words: 8
+        
+
+
+
+

Variables use in a program : n , cnt

+
+
+

Complexity

+

The above program iterates n log10(n) times

+

So time complexity is O(log10(n))

+
+
+ + + \ No newline at end of file