Find sum of digits of a number | Java

preview_player
Показать описание


More c++, Java programs, and much more will be uploaded and explained in detail.

Subscribe to my channel so that you do not miss any topic.

My other videos-

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

This is exactly the video I needed. I needed a visual and explanation to understand how it was working

johnnymedina
Автор

Best explanation I have ever came across so far

purvajagtap
Автор

Really sir you explain it the best and I understand it very easily. Thanks a lot sir

seikhnawaid
Автор

Thank you for this❤ I have been searching it since long and got the best explanation😊

aishwaryakatre
Автор

Thank you soo much, Please Please Please post more video like this 🙏. i want to learn java.

soumitrasdestination
Автор

Brother best explanation ever
Thank you so much

coolgirl
Автор

Thanks a lot, tomorrow is my computer exam and I'm learning from your channel....

logesh
Автор

beautiful way of presentation .thanks a lot

mdrmhup
Автор

Best explanation bro
U guys will be shocked to know that I am studying 9th class learning java for my computer exam next month.
4:59---Y didn't U write while (n!=0).

tarakram
Автор

import java.util.*;
public class digi
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int n;
double r=0.0, s=0;
n=in.nextInt();
while(n!=0)
{
r=n%10;
s=s+r;
n=n/10;
System.out.println(""+r);
}
System.out.println("Sum of the digits="+s);
}
}



A full program
Scanner class is not needed if you do not have anything to input in program later on

shreshthsrivastava
Автор

This was so helpful... definitely subscribing🔥

keyBladeSkai
Автор

Keeping on doing videos....best of luck

prasannakumar-ygbn
Автор

Best explanation, Thank you so much Sr,
Your videos are very helpful for me for better understanding coding
Please, Make video for Using how to use Debugging in a Program, I'm looking for this videos from You Tube but I couldn't find yet.

Umida
Автор

Hello sir, ek question h ? WAP in Java to generate natural no.series up to 10 by using function.sir plz bta dijiye

mahigaming
Автор

Sir can u plz Tel me why should it divide by 10 plzzzz

sinchanarhegde
Автор

Hello sir mujhe Java se ek program puchna hai?WAP in Java to assign any no.in program to display sum of up to that no by using function, plz sir jaldi bna dijiye, ya phir ise comment ker dijiye

mahigaming
Автор

Sir aap comment box me hi iska program bta dijiye plz sir

mahigaming
Автор

how is 437 / 10 = 43?? it should be 43.7 correct?

jianyilee