Frequently Asked Java Program 08: Count Sum Of Digits in a Number

preview_player
Показать описание
Topic : Count Sum 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
**************************

#DigitSumFAQ
#NumberSumQueries
#SumOfDigitsExplained
#MathDigitSumHelp
#DigitTotalSolutions
#NumberCrunchingTips
#SumOfDigits101
#MathPuzzleSolvers
#DigitSumInsights
#NumberAnalysis
#MathQuerySolvers
#DigitSumTricks
#NumberProperties
#SumOfDigitsExploration
#MathEnthusiasts
#DigitSumTechniques
#NumberMysteries
#SumOfDigitsSolved
#MathHacks
#DigitSumProblems
#NumberSumsUnraveled
#SumOfDigitsSolutions
#MathExplainers
#DigitSumChallenges
#NumberTheory
#SumOfDigitsHelp
#MathSolvers
#DigitSumWalkthrough
#NumberPuzzleLovers
#SumOfDigits101
#MathGeniuses
#DigitSumStrategies
#NumberCuriosities
#SumOfDigitsTips
#MathWhizzes
#DigitSumQnA
#NumberSumsDemystified
#SumOfDigitsDiscussion
#MathCommunity
#DigitSumSolutions
#NumberCracking
#SumOfDigitsExplained
#MathGurus
#DigitSumHelp
#NumberSense
#SumOfDigitsSolved
#MathProblemSolvers
#DigitSumGuidance
#NumberAnalysts
#SumOfDigitsChallenges
Рекомендации по теме
Комментарии
Автор

I truly appreciate the detailed explanations you give. That approach provides quality insight into Java mechanism (what happens, when, and how), which is helpful to truly understand every aspect of the code.

marko
Автор

I solved this by pausing the video great . The playlist really helped me gain knowledge.

Me_out_of_office
Автор

Thanks for the nice explanation! I have an assignment like this but I am struggling about a day on how to answer it. Thanks again sir

karlmarxroxas
Автор

Every tutorial is very professional ...Thanks

Move_Further
Автор

sir what if num is not given and the person has to input the number after the compile

Goldenknight-gf
Автор

Function Main
Declare Integer number, i, sum

Output "Please enter an Integer number: "
Input number
Assign sum = 0
While number > 0
Assign sum = sum + number%10
Assign number = number/10
End
Output "The sum is : " & sum
End

HocineFerradj
Автор

Having small doubt, how 1%10 will give 1 as a remainder

ramjitarla
Автор

You explain it the best way thanks a lot sir... u made understanding Java easy.... there must be same prof in clg

gauri
Автор

Hello sir, I watched all videos ...mind blowing explanation . Thank you so much sir.But i want to ask one in these program you are using while loop? Can I use for loop instead of while loop?

SumanKumari-cnwo
Автор

Thanks Pawan SIr for this nice explanation. I like your all videos and also purchase your Udemy course for Automation Testing.
One question regarding above programme.
If I use For loop then for 12345 it shows wrong answer. It shows me 14 but actual answer should be 15. what is the reason behind that, please guide me?
Thanks

mahendradhanait
Автор

Sir, without writing count++, how does the loop runs?? As in ur previous examples you wrote count++. Can you please answer my question

vijayalakshmigorrela
Автор

Congratulations! Your explications are well made and lessons very intrresting! Keep in touch!

johnnyjohn
Автор

package javaapplication23;

import java.util.Scanner;

public class JavaApplication23 {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);
StringBuilder sb = new StringBuilder();

System.out.println("String: ");
int num = sc.nextInt();

int numBackUp = num;//Before the alteration of Number.
int digitSum = 0;
int reverse = 0;

while (num != 0){
reverse = reverse*10 + num%10;
num = num / 10;
}

while (numBackUp != 0){
digitSum += numBackUp % 10;
numBackUp = numBackUp / 10;
}

int numDigits =
int reverseDigits =





}

}

kvelez