Java program to count digits in an Integer

preview_player
Показать описание
#learnwithkrishnasandeep #javacodinginterviewquestions #javaexamples #javaprograms #javatutorials #javaprogramming 1) How to read a matrix from console in java?

2) How to remove duplicates from string in java?

3) Write a java program to duplicate characters with number of occurences in java?

4) Write a java program to implement bubble sort part 1?

5) Write a java program to check string is palindrome or not?

6) Write a java program to print floyds triangle?

7) Write a java program to print floyds triangle?





8) How to count number of vowels in a string in java?

9) How to find largest and smallest values in an array in java?

10) Write java program to find duplicate elements in array in java?

11) write a java program to check the input number is prime or not in java?

12) Write a java program to print pyramid pattern of numbers?

13) Write a java program to find missing number in array in java?

14)Write a java program to print numbers in java up to 10 with out using loops?

15) How to sort elements in array in asc and desc order in java?



16) Write a java program to find factorial of a number in java?

17) write a java program to find second largest element in the array in the java?

18) Write a java program to check two Strings are anagrams or not by sorting and comparing strings?

19) Write java program to print Characters count in each word in String ?

20) Write a java program to find reverse of a string in java?

21) Write a java program to add elements in an array in java?

22) Write a java program to find largest of three numbers?



23) Write a java program to print multiplication table?

24) Write a java program to print star pattern?

25) Write a java program to find factors of number from 1 to 100

26) Write a java program to print fibonacci series using loops?

27) Write a java program to print Ascii values of a Character ?

28) write a java program to implement bubble sort - Part 2?

29) Write a java program to print fibonacci series ?

30) Write a java program to sort characters in String in java?

31) How to sort hashmap keys in java?

32) Write a java program to check two strings are anagrams or not?

33) Write a java program to find factorial for large number?

34) Write a java program to find even and odd number?

35) How to Swap two numbers without using third variable in java?(Addition and subtraction operation)

36) Write a java program to convert Fahrenheit to celsius?

37) Write a java program to find reverse of a number in java?

38) Write a java program to print alphabets?

39) Write a java program to check given input character is alphabet or not ?

Рекомендации по теме
Комментарии
Автор

I don't know if this is allowed, but you can do it with Strings too:
int number = 120;
String numberStr = String.valueOf(number);
System.out.println("The number has " + numberStr.length() + " digits");

virtuosek
Автор

Yr recurrsive baale thoda acha s samjha diya karo!!appna jaldi jaldi m nikal diya

surbhijain
Автор

One more idea - Convert the digit in String, and check the length

AwaraGhumakkad
Автор

We can find no of digits of a number in O(1) time and yr approach will take O(no of digits) .

ajitkumaryadav
Автор

Ecellent sir.This really helped me a lot.Many many thanks

shubhamkumar-gwvb
Автор

does anyone know the algorithm to show the digits of this number including the zeros 0001. should show 4 digits.

robertmasters
Автор

In the first approach, why you divide it by 10?

buthynah
Автор

heloo bro nice explantion but i have some more vedeos about progamming like strings and arrys and palandrom with diffrent examples

megameganath
Автор

int num = 1234;
int Len= (int) Math.floor( Math.log10( num) + 1 );
System.out.println("Count of digits = "+ Len);

abhishekmane
Автор

Anna please made some programs important for ibm in java

maheshgoud