Frequently Asked Java Program 06: Count Number Of Digits in A Number

preview_player
Показать описание
Topic : Count Number Of Digits in A Number

#########################
Udemy Courses:
#########################

Manual Testing+Agile with Jira Tool
************************************

Selenium with Java+Cucumber
********************************

Selenium with Python & PyTest
********************************

Selenium with python using Robot framework
****************************************

API Testing(Postman, RestAssured & SoapUI)
*****************************************

Web & API Automation using Cypress with Javascript
********************************************

Playwright with Javascript
**************************

Jmeter-Performance Testing
************************

SDET Essencials(Full Stack QA)
*************************

Appium-Mobile Automation Testing
************************************

Java Collections
*****************

Python Programming
*********************

Cucumber BDD Framework
***************************

Protractor with Javascript
***************************

####################################
Youtube Playlists:
####################################

Manual Testing & Agile
***********************

SQL
*************************

linux & Shell Scripting
**********************

Java
**********************

Selenium With Java+Cucumber
********************************

Python
********************************

Selenium With Python,Pytest&Behave
***************************************

Selenium With Python Using Robert Framework
(Web&API Testing)
*************************************************

API Testing (Postman,SoapUi,&Rest Assured)
**********************************************

Mobile App Testing Appium
****************************

Performance Testing Jmeter
*******************************

Maven,Jenkins,Git,Github,CI/CD
*******************************

SQL,DB Testing&ETL,Bigdata
*******************************

JavaScript Based Automation Tools
********************************

Selector Hub Tools
********************

GraphQL
******************

Cypress API Testing
********************

Cypress Web Testing
**********************

Playwright with Javascipt
**************************

#DigitCount
#NumberDigits
#CountNumberDigits
#NumberLength
#DigitEnumeration
#NumericDigits
#DigitsInNumber
#CountingDigits
#NumeralCount
#NumberSize
#NumberLengthCheck
#DigitTally
#NumericMagnitude
#NumberLengthAnalysis
#NumeralQuantity
#DigitTotal
#CountingNumerals
#NumberLengthCalculation
#NumeralEnumeration
#NumberCharacteristics
#DigitPresence
#DigitQuantity
#NumericLength
#CountDigits
#NumberLengthInsight
#DigitCheck
#DigitQuantification
#NumericMagnitudeCheck
#NumberLengthAwareness
#NumeralTotal
#DigitObservation
#DigitAmount
#NumberStructure
#CountingNumerics
#NumeralQuantityCheck
#NumberMetric
#DigitCalculation
#NumericLengthAnalysis
#CountingCharacters
#NumberDigitness
#DigitAwareness
#NumberLengthEvaluation
#NumeralValue
#DigitInsight
#NumberCharacterization
#CountingNumberSymbols
#NumeralPresence
#NumberMagnitude
#DigitQuantitativeAnalysis
#NumericStructure
Рекомендации по теме
Комментарии
Автор

Sir we need your video specifically to reach how to debnug code.
1. Java program.
2. Rest api
3. On. different IDEs like Intellij

r.rajalakshmi
Автор

int num = 1234;
String s = "" + num;

mihirnarayan
Автор

You explain it the best way thanks a lot sir...

gauri
Автор

Thank you so much sir because of you i am able to do coding.

akshaykathole
Автор

int len = (int) (Math.log10(num) + 1)

this is also a way to find the length in O(1) time complexity

syedsaifahmed
Автор

By converting to String

class HelloWorld {
public static void main(String[] args)

{
int num= 122345;
int length =
System.out.println(length);

}
}

Mr_Raz_
Автор

Input to give multiple values
Ex: 12 24 4 3 78
In this value which is odd number and which place is odd number (mention palcement 4th is place is odd number) pls explain this method

ananya
Автор

How to count number of digits in a number starting with zero? For example if I enter a number 0123, the count output I must get is 4.

abhi
Автор

public class CountDigits {
public static void main(String[] args) {
int N = 101;
Double d = new Double(Math.log10(N));
System.out.println( d.intValue() + 1);
}
}

pavankumar-brof
Автор

At 6:47 count will be 6 . I think please check, you said it 5 again

tsb_vlog
Автор

In this programme if we give input number which is starting from 0 then it will not count that 0 because is condition is
while(num>0){
}

vyankateshodilwar
Автор

Hi Pavan sir in this program can we take in while condition as num!=0??

mandardeshpande
Автор

What to do when number entered starts from 0?
For eg - when number entered is 0123, count shows 3 instead of 4.
Kindly help.

ompa
Автор

# Number of characters in a string
public class NumberOfCharacters {

public static void main(String[] args) {

String str = "Abhi";



}

}

_abhi
Автор

what if n = 000;
the count will always be 0, but number of digits in n will be 3

_nikhilyarnal
Автор

sir, how to sort string while ignoring Case
for eg input: Apple is Red
output : AeeilppRs

fahyiensher
Автор

Can anyone try the input starting from 0, for eg. 0123, result showing count value to 3 instead of 4, if yes the program is incorrect, cause even if the input is starting from 0, the length should be given accurate by above program.Can You help me Sir, with regard to this.

HallOfMemeYT
Автор

can we just get the number as a string and use string.length() will it work?

shaileshkumar.t
Автор

char[] chr =
System.out.println("Number of digits are "+chr.length);

sajauddinmulani
Автор

public class CountNumOfDigits {

public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number");
int num = sc.nextInt();

int count = 0;

for(int i=0; i<num; i++) {
if(num!=0) {
num = num/10;
count++;
}
}
System.out.println(count);
sc.close();
}
}

Sir, If I use for loop instead of while loop it is giving less number than a digit (eg: 1234 = 3).

Can you please provide me the solution for this?

pavankumar-ihdw