Find sum of digits of a number | Java

  Рет қаралды 70,765

B Tech Computer Science

B Tech Computer Science

Күн бұрын

Пікірлер: 60
@johnnymedina6456
@johnnymedina6456 2 ай бұрын
This is exactly the video I needed. I needed a visual and explanation to understand how it was working
@purvajagtap
@purvajagtap 4 жыл бұрын
Best explanation I have ever came across so far
@hariharanc8019
@hariharanc8019 3 жыл бұрын
yas
@lesleejezzelbuot8068
@lesleejezzelbuot8068 Ай бұрын
Hi! I'm a new subscriber I just found your channel recently and I find it very helpful especially for slow learners like me. I just wanna let you know that you are my LIFE SAVIOR! keep it up...
@BTechComputerScience
@BTechComputerScience Ай бұрын
@@lesleejezzelbuot8068 thanks a lot for such positive comment 🙃
@logesh8933
@logesh8933 2 жыл бұрын
Thanks a lot,tomorrow is my computer exam and I'm learning from your channel....
@BTechComputerScience
@BTechComputerScience 2 жыл бұрын
Hehe, All the best! 😊
@logesh8933
@logesh8933 2 жыл бұрын
@@BTechComputerScience bro in my book programs are like getting input from the user and doing the programs(without value or number)but in your videos you are doing it with numbers,give me some tips
@logesh8933
@logesh8933 2 жыл бұрын
@@BTechComputerScience and bro where are you from;)
@BTechComputerScience
@BTechComputerScience 2 жыл бұрын
@@logesh8933 instead of taking input using- Scanner s = new Scanner(System.in); int n = s.nextInt(); Above 2 lines are used to take input from user, in above case, whatever int value the user enters will be stored in 'n' and well be using that 'n' variable in our program. Instead of that, I have simply taken input like this- int n =10; something like that. So if question demands u to take input from user, use Scanner and stuff, else just declare all the variables u want to use like I do in my videos.
@BTechComputerScience
@BTechComputerScience 2 жыл бұрын
@@logesh8933 secret 😉
@soumitrasdestination
@soumitrasdestination Жыл бұрын
Thank you soo much, Please Please Please post more video like this 🙏. i want to learn java.
@aishwaryakatre786
@aishwaryakatre786 Жыл бұрын
Thank you for this❤ I have been searching it since long and got the best explanation😊
@seikhnawaid9769
@seikhnawaid9769 3 жыл бұрын
Really sir you explain it the best and I understand it very easily. Thanks..... Thanks a lot sir
@Messui_Editz34
@Messui_Editz34 Ай бұрын
Good job brother.
@coolgirl8321
@coolgirl8321 2 жыл бұрын
Brother best explanation ever Thank you so much
@vijaykapse7604
@vijaykapse7604 2 жыл бұрын
truly awesome easiest way at all...........
@BhargaviGuntakala
@BhargaviGuntakala Жыл бұрын
beautiful way of presentation .thanks a lot
@tarakram1908
@tarakram1908 3 жыл бұрын
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).
@BTechComputerScience
@BTechComputerScience 3 жыл бұрын
All the best
@tarakram1908
@tarakram1908 3 жыл бұрын
My exam is completed 😎😎
@BTechComputerScience
@BTechComputerScience 3 жыл бұрын
@@tarakram1908 Did u do well?😊
@tarakram1908
@tarakram1908 3 жыл бұрын
I did practicals well but lost many marks in theory
@BTechComputerScience
@BTechComputerScience 3 жыл бұрын
@@tarakram1908 ok, having practical Knowledge is what matters. Great!
@mithank2666
@mithank2666 2 жыл бұрын
Thank you THANK YOU thank YOU SO much
@shreshthsrivastava2234
@shreshthsrivastava2234 2 жыл бұрын
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
@shivaagarwal7406
@shivaagarwal7406 3 жыл бұрын
Thanks for easy explanation :)
@BTechComputerScience
@BTechComputerScience 3 жыл бұрын
Glad it was helpful!
@umavijay9171
@umavijay9171 4 жыл бұрын
wow good explanation
@ahyansheikh281
@ahyansheikh281 4 жыл бұрын
Its very helpful thankuu soo much sir
@BTechComputerScience
@BTechComputerScience 4 жыл бұрын
I have few more such videos :) Hope it helps
@manjusingh5338
@manjusingh5338 2 жыл бұрын
well explained
@Llama143
@Llama143 3 ай бұрын
thank you for thiss!
@prasannakumar-yg7bn
@prasannakumar-yg7bn 4 жыл бұрын
Keeping on doing videos....best of luck
@ahmedtipa3563
@ahmedtipa3563 3 жыл бұрын
very good
@nidhiterni2368
@nidhiterni2368 Жыл бұрын
Thank you sooooo much 😊❤
@mahigaming3948
@mahigaming3948 3 жыл бұрын
Hello sir ,ek question h ? WAP in Java to generate natural no.series up to 10 by using function.sir plz bta dijiye
@ashelark
@ashelark Ай бұрын
Sir in the last condition, how 4%10 is possible?
@ashweenramesh6927
@ashweenramesh6927 Жыл бұрын
Tq for this video
@BTechComputerScience
@BTechComputerScience Жыл бұрын
M glad it helped u!
@preeti_dutta15
@preeti_dutta15 3 жыл бұрын
best explanation thks
@keyBladeSkai
@keyBladeSkai 2 жыл бұрын
This was so helpful... definitely subscribing🔥
@BTechComputerScience
@BTechComputerScience 2 жыл бұрын
Thanks for the support!
@venkataiahbattula6781
@venkataiahbattula6781 3 жыл бұрын
Thanks bro for great explanation
@sakinaabbas737
@sakinaabbas737 6 ай бұрын
appreciated
@RahulKumar-sx8hm
@RahulKumar-sx8hm Жыл бұрын
bro please do some more vedios
@RajkamalKamal-mu4kn
@RajkamalKamal-mu4kn 2 жыл бұрын
Make it simple.🥰🔥tqq
@Umida995
@Umida995 2 жыл бұрын
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.
@subscribeonlinkifureadcomm3700
@subscribeonlinkifureadcomm3700 2 жыл бұрын
Sir is it on logical program ?
@mahigaming3948
@mahigaming3948 3 жыл бұрын
Sir aap comment box me hi iska program bta dijiye plz sir
@amarnath3903
@amarnath3903 4 жыл бұрын
Thank you sir
@sinchanarhegde877
@sinchanarhegde877 3 жыл бұрын
Sir can u plz Tel me why should it divide by 10 plzzzz
@BTechComputerScience
@BTechComputerScience 3 жыл бұрын
Everytime we divide the number by 10, we ll remove last digit of the original number. For example we have n = 345 (n is an integer) so when we divide n by 10, (n/10), we ll get 34.5 but since n is integer, our complier will ignore the .5 and will store only 34 inside n. So by dividing by 10, we are slowly removing one digit in every iteration of our loop
@mahigaming3948
@mahigaming3948 3 жыл бұрын
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
@BTechComputerScience
@BTechComputerScience 3 жыл бұрын
Is this what u r looking for? kzbin.info/www/bejne/jKvQkJefatRopbM
@jianyilee9419
@jianyilee9419 3 жыл бұрын
how is 437 / 10 = 43?? it should be 43.7 correct?
@BTechComputerScience
@BTechComputerScience 3 жыл бұрын
since 'n' is of type 'int' (Integer), the compiler will only store the 'int' part of 43.7 into 'n' ( integer part of 43.7 is 43) if 'n' was of type 'float' or 'double', the compiler will store 43.7 into 'n'
Use of "if - else" | Java
6:32
B Tech Computer Science
Рет қаралды 3 М.
Count the number of Digits of a Number | Java
6:19
B Tech Computer Science
Рет қаралды 39 М.
Amazing remote control#devil  #lilith #funny #shorts
00:30
Devil Lilith
Рет қаралды 16 МЛН
HELP!!!
00:46
Natan por Aí
Рет қаралды 70 МЛН
Algebra Video Simulation 1 31 V2
2:11
iPREP
Рет қаралды 2
Java Program #8 - Fibonacci Series of Numbers in Java
6:36
Programming For Beginners
Рет қаралды 31 М.
If __name__ == "__main__" for Python Developers
8:47
Python Simplified
Рет қаралды 413 М.
Java Program #3 - Add Digits in a Number Entered by User
6:38
Programming For Beginners
Рет қаралды 5 М.
Testing Mock Interview| Java Mock Interview For Freshers
29:17
RD Automation Learning
Рет қаралды 411 М.
Finding Reverse of a Number | Java | Detailed Explanation
11:36
B Tech Computer Science
Рет қаралды 54 М.
Beginners Should Think Differently When Writing Golang
11:35
Anthony GG
Рет қаралды 120 М.
Amazing remote control#devil  #lilith #funny #shorts
00:30
Devil Lilith
Рет қаралды 16 МЛН