Armstrong Number | To check if a given number is an Armstrong number or not | Java

  Рет қаралды 72,940

B Tech Computer Science

B Tech Computer Science

Күн бұрын

Пікірлер: 82
@Btechquastions-zh5cy
@Btechquastions-zh5cy 6 ай бұрын
class Ambstrong { public static void main(String[] args) { int n =153; int temp; int amb = 0; int original = n; while(n>0){ temp = n%10; temp = (int)Math.pow(temp,3); amb = amb+temp; n = n/10; } if(original==amb){ System.out.println("amb"); }else{ System.out.println("not amb"); } } } Thank you so munch... 👌
@prakharsrivastava5130
@prakharsrivastava5130 2 жыл бұрын
*Check Armstrong number for n digits* import java.lang.*; import java.util.Scanner; public class armstrongNum { public static void main(String[] args) { // Asking for INPUT from USER System.out.print("Enter a Number: "); Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int s = n; int m = n; double r,q = 1; int counter=0; double sum=0; // To count number of Digits entered by USER while (n > 0) { r = n % 10; n = n / 10; counter++; } // Logic here while (m > 0) { q = m % 10; q=Math.pow(q,counter); sum+=q; m = m / 10; } // Checking if (sum==s) { System.out.println("Yes it is a Armstrong Number"); } else { System.out.println("Not a Armstrong Number"); } } }
@sarahfatima9840
@sarahfatima9840 3 жыл бұрын
Splendid!! Your method of first explaining each step before writing the program is amazing. I have been struggling since months to find a good computer teacher and I never understood these concepts but after watching your video I feel blessed. I have understood. Thank you❤️!
@BTechComputerScience
@BTechComputerScience 3 жыл бұрын
Hey thanks... ur satisfaction means a lot to me😊
@sarahfatima9840
@sarahfatima9840 3 жыл бұрын
@@BTechComputerScience No worries🤭💗
@Mulllana_Haramudil-AlHarami
@Mulllana_Haramudil-AlHarami 2 жыл бұрын
CS sir with least technology you are best . Your explanation at each & step is amazing 😍. Keep it up ;
@Reahroy-fr4jl
@Reahroy-fr4jl 6 ай бұрын
Thank you so much ❤ please continue to do like these videos❤❤❤
@vikrambahure8639
@vikrambahure8639 8 ай бұрын
very easy steps ...thanks sir
@sreejayvlogs
@sreejayvlogs Жыл бұрын
Awesome bro…. 😊 it’s so clear
@kainaatmakhani6550
@kainaatmakhani6550 3 жыл бұрын
u made my life very easy thankyou so much.
@NailPassion999
@NailPassion999 Жыл бұрын
Excellent explanation😃
@mounimouni224
@mounimouni224 2 жыл бұрын
Detailed one..!! Great Thank you..!!
@keerthanaselvaraj6791
@keerthanaselvaraj6791 Ай бұрын
How to find the first,last and middle number in an given input in java ,post a video for this ques .The method of teaching in the notebook is easily understandable.Good teaching methodology.
@anusharasumolla3017
@anusharasumolla3017 5 ай бұрын
Thank you so much your videos helped me a lottttttt
@ShivaKumar-yy2ym
@ShivaKumar-yy2ym 3 жыл бұрын
Thank you so munch... Great work 👍
@mepreetii
@mepreetii 11 ай бұрын
Hi sir you should initialize temp as double as math pow cant be in int data type
@BTechComputerScience
@BTechComputerScience 11 ай бұрын
Yes correct!
@payalnishad1854
@payalnishad1854 2 жыл бұрын
Superb bro. 🙏thanks alot for make coding this easy... I was unable to understand the armstorng concept but when I came across your video now I started considering myself pro at coding😝😂👍
@BTechComputerScience
@BTechComputerScience 2 жыл бұрын
😂👍
@Kishore-xz6cb
@Kishore-xz6cb 7 ай бұрын
everyone learning the program meanwhile me getting saced in 2am by hearing a brid sound 4:28😂
@sindhuhari2628
@sindhuhari2628 3 жыл бұрын
Brother there we need to do explicit type conversion near applying power else we will get an lossy conversion error
@BTechComputerScience
@BTechComputerScience 3 жыл бұрын
Yes, students are smart and will figure it out😊, they won't like if I spoon feed everything! Thanks for supporting!
@Giriagroandfashion
@Giriagroandfashion 2 жыл бұрын
How to do Brother??? Can You Please Explain
@Misartlog_brush
@Misartlog_brush 2 жыл бұрын
It was very helpful, thanks
@BTechComputerScience
@BTechComputerScience 2 жыл бұрын
Glad it was helpful 😊
@docmusiq
@docmusiq 2 жыл бұрын
If your loss conversation, just change your temp data type from integer to double...eg declare your temp like: double temp; Your explanations are amazing, especially the way you break down the question through pseudo-code and you show every declared variable duty while executing the code...
@BTechComputerScience
@BTechComputerScience 2 жыл бұрын
Really glad u like it 😊
@saikrishna-fg2so
@saikrishna-fg2so 2 жыл бұрын
please copy the code in the comment session, it have some errors
@sandhyabonagiri8330
@sandhyabonagiri8330 2 жыл бұрын
Tq alot bro....🥰🥰🥰🥰
@ravinatram
@ravinatram 3 жыл бұрын
Pls give description of variables pls
@venkatakumargangapatla4510
@venkatakumargangapatla4510 2 жыл бұрын
Thank u soo much sir 🤝🤝🤝
@Aishwarya_Shettar
@Aishwarya_Shettar 3 ай бұрын
Sir,make vdo on Find a armstrong number btwn 2 numbers!
@sindhuhari2628
@sindhuhari2628 3 жыл бұрын
And why aren't you uploading videos these days
@priyankapatil6521
@priyankapatil6521 3 жыл бұрын
Sir ...plz how to generate random number par vedio banao ..
@appuappu8466
@appuappu8466 2 жыл бұрын
Write a program add two number without using additional operator in java. How to sir
@SourabhPrajapatArts
@SourabhPrajapatArts 3 жыл бұрын
thanks bro
@sureshirla4283
@sureshirla4283 2 жыл бұрын
Sir akkada 153 number iccham kabatti math.(temp 3 ) ani pettaru but asalu ye number ivvakunda Armstrong aa kadha ani telusukovadam ela
@saikrishna-fg2so
@saikrishna-fg2so 2 жыл бұрын
please copy the code in the comment session, it have some errors
@antonychellamarul
@antonychellamarul Жыл бұрын
Sir, *Definition Check* An Armstrong number is a positive n-digit number that is equal to the sum of the nth powers of their digits. (not only by cubes ,cubes for only 3 digits). Ex: 8208 = (8^4 + 2^4 + 0^4 + 8^4) = 8208. *not by cubes* .
@BTechComputerScience
@BTechComputerScience Жыл бұрын
Yes that's true, this is for beginner level, once u learn this, we can do it for any number of digits. Easy.
@aishwaryas5146
@aishwaryas5146 2 жыл бұрын
Where is execution part?
@durgabhavani5855
@durgabhavani5855 Жыл бұрын
Sir If u don't mine u r way of explanation is so nyc but u r voice is not audible properly please raise u r voice sir
@BTechComputerScience
@BTechComputerScience Жыл бұрын
Hey thanks for letting me know, I ll improve it
@greeshmikaagarwal256
@greeshmikaagarwal256 3 жыл бұрын
Thank you
@PreethiRenu
@PreethiRenu Жыл бұрын
anna ,Armstrong number in a given range in java edhuku coding vanum anna pls video upload 😔pannunga
@kiranmairuben2978
@kiranmairuben2978 3 жыл бұрын
Error in temp= math.pow(temp, 3); pls help
@ashishannappa6908
@ashishannappa6908 3 жыл бұрын
It will typemissmatch
@ashishannappa6908
@ashishannappa6908 3 жыл бұрын
Try another method
@sureshirla4283
@sureshirla4283 2 жыл бұрын
Temp=(int)math.pow(temp,3) try this bro
@deamoneye5075
@deamoneye5075 3 жыл бұрын
Concept is Wrong, Pow(Num,Length) is right .
@BTechComputerScience
@BTechComputerScience 3 жыл бұрын
Yup.. that's right! But m just teaching the basics.. so that students can understand the core and then move to a little more complex programs where they can mix 'Armstrong' and 'count number of digits of the given number' to perform what you just mentioned
@vishalrc6903
@vishalrc6903 2 жыл бұрын
i get error when i use math.pow conversion type error what to do now
@BTechComputerScience
@BTechComputerScience 2 жыл бұрын
Share the code, let me have a look
@vishalrc6903
@vishalrc6903 2 жыл бұрын
@@BTechComputerScience where to share it? Insta?
@BTechComputerScience
@BTechComputerScience 2 жыл бұрын
@@vishalrc6903 just copy paste the code in the comment
@StudyPulse-uh7hk
@StudyPulse-uh7hk Ай бұрын
❤❤❤
@naveena1441
@naveena1441 3 жыл бұрын
👍👍👍👍👍👍👍
@aishwaryas5146
@aishwaryas5146 2 жыл бұрын
@3:05 so many mosquitoes my ears...
@salmanparsi8239
@salmanparsi8239 3 жыл бұрын
Very usefull you deserve a like
@Chari-007
@Chari-007 3 жыл бұрын
👍👏👏👏👏
@HiteshSote
@HiteshSote 2 жыл бұрын
What is about 1634
@aishwaryas5146
@aishwaryas5146 2 жыл бұрын
Armstrong we will get 308 so answer is not armstrong
@Giriagroandfashion
@Giriagroandfashion 2 жыл бұрын
Getting error at Math.pow line
@kiranmairuben2978
@kiranmairuben2978 3 жыл бұрын
Error in temp= math.pow(temp,3); Pls help
@BTechComputerScience
@BTechComputerScience 3 жыл бұрын
Try importing this - import java.lang.Math;
@mohammadsajid8924
@mohammadsajid8924 3 жыл бұрын
@@BTechComputerScience kr diya import tb bhi error aarha pls help
@bumbada1
@bumbada1 2 жыл бұрын
@@mohammadsajid8924 if you have stored temp in int that can throw an error type cast it : temp= (int) Math.pow(temp,3);
@bumbada1
@bumbada1 2 жыл бұрын
@@BTechComputerScience explanation: pow method returns a double so if your temp is not double, you need to type cast it
@mahaperumal5872
@mahaperumal5872 3 жыл бұрын
why divided by 10 please any one explain
@Giriagroandfashion
@Giriagroandfashion 2 жыл бұрын
To get the Quotient i...e., 15
@kainaatmakhani6550
@kainaatmakhani6550 3 жыл бұрын
sir plzz make video of palindrome number in java?
@BTechComputerScience
@BTechComputerScience 3 жыл бұрын
Watch my palindrome for strings video, a good coder like u can easily modify it for numbers 😊
@tech-learner4555
@tech-learner4555 3 жыл бұрын
How u fix ur cam frmd
@BTechComputerScience
@BTechComputerScience 3 жыл бұрын
it's a pretty messed up setup right now, previously I was using a phone holder like this one amzn.to/3ArD6YE
@tech-learner4555
@tech-learner4555 3 жыл бұрын
Thanks 🙏🏻
@Solomoon-ce5wx
@Solomoon-ce5wx 2 жыл бұрын
Not like it
@Swatisirmour
@Swatisirmour Жыл бұрын
Too much complicated
@BTechComputerScience
@BTechComputerScience Жыл бұрын
Practice more, do more coding... then it might not seem very complicated!
@abdulrahim7763
@abdulrahim7763 11 ай бұрын
tried without while loop..this is working fine for me (give any number within the limit of integer data type) Scanner sc=new Scanner(System.in); System.out.println("Enter any number to find out if it is a Armstrong number or not"); int input=sc.nextInt(); String s=""; String count=s.valueOf(input); int input_size = count.length(); int digit; double Armstrong=0; double result=0; int actual=input; if(input>0) { for(int i=1;i
@BTechComputerScience
@BTechComputerScience 11 ай бұрын
It's really great that u tried on your own and came up with great logic.😊
@muvvaranjithkumar7260
@muvvaranjithkumar7260 Жыл бұрын
thank you bro
Sum of 'n' Natural Numbers | With and Without Loop | Java
4:47
B Tech Computer Science
Рет қаралды 11 М.
Strong Number | Java | Program to Find if the Given Number is Strong Number
11:26
B Tech Computer Science
Рет қаралды 17 М.
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
How to STUDY so FAST it feels like CHEATING
8:03
The Angry Explainer
Рет қаралды 2,6 МЛН
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 424 М.
L10. Check if a LinkedList is Palindrome or Not | Multiple Approaches
20:02
Palindrome |  Program to check if a string is Palindrome | Java
9:31
B Tech Computer Science
Рет қаралды 120 М.
L3. Check if a Number if Prime or not | Maths Playlist
7:10
take U forward
Рет қаралды 49 М.
How to Remember Everything You Read
26:12
Justin Sung
Рет қаралды 2,7 МЛН
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
Try this prank with your friends 😂 @karina-kola
00:18
Andrey Grechka
Рет қаралды 9 МЛН