Java program to check number is armstrong or not | Learn Coding
ฝัง
- เผยแพร่เมื่อ 7 ธ.ค. 2020
- Java Full Course for Beginners...!👇👇
• Java Programming
Please Like | Share | SUBSCRIBE our Channel..!
Learn Coding
🙏🙏🙏
Like our Facebook Page...!
Learn Coding
Don't forget to tag our Channel...!
#ArmstrongNumber
#LearnCoding
#ask4help
#armstrongprogram
#checkarmstrongornot
#JavaArmstrongProgram
#ArmstrongInJava
#programforarmstrongnumber
#ArmstrongOrNot
#JavaArmstrongProgram
The way your teaching java is really appreciable.👏
Thank you so much 😊
I hardly do comments but i have to say your teaching way is awesome, Im learning alot from your videos..... Thank you so much.
today was my first day or first experienced in your TH-cam channel and I like it most the way you teach
sir it's an request to you keep it up and keep teaching us 😊😊
very nice boss, i can say for 100% that no one in youtube has taught as simple as like you, thank you so much
I agree 💯
Yes you are right
I liked the video very much and the line explaination with logic best teaching video seen till now
The way you teach is truly amazing and make so simple to understand
Thank you sir ❤....!
Wow.... Kya Samjhaya apne! Very simple and understandable.
The "BEST" explanation ever💫
simple and nice logic sir thankyou so much
sir great learning... great knowledge..... smooth understanding ....all the best
You are done great work thank you so much for creating this video ☺️
Thank you so much..after years of nt understanding this program..I just done it today👍🏻🙌
Thanks you sir your method is very easy and clear in short time ❤
Explanation is great, thanks
You teach programming the best 🙏🙏
Thanks bro, finally i understood this logic on your channel ❤️🔥
best teacher of programming
Milestone for beginners ❣️
simple and shandar logic
Thank u sir .
Ur teaching is very easy to learn....
your paper pen work is OSM .thankyou sir.
Thank you so much sir
You are a life saver 🙏🙏
Great 👍
bhut gajab ka logic he bhai 👌👌
Woww amazing 👍
Nice explanation
nice explanation ,sir.
Ek number explain kiya apne logic
Nice explanation sir thank you.
Sir aap ki vajah se me Java sikh paya hu
Bohat ache se samjhaya 👏🏻👏🏻👏🏻
Best viedo sir Thank you u very much
Thks sir very helpfulll...
Wa yaar Bhai achee achee Sikh k jayege
Great job brother 🎉
Good job
I love your teaching style. The way you teach us is fantastic. The Armstrong number program you taught us in this video , is wrong concept. Please correct it.
but this logic is not applicable for more than 3 digital numbers
but simple logic for three digitals...thank you so much
same bro
Sir aap bahot achha padhate ho
Thank you much sir....
thank you so much sir
after While loop the n value will be =0 and we will compare the value 0 in if else. Thanks Sir 👍👍
Great
ek no. sir
mast bhai
Thanks sir ji
I also tried my own sir
Suprr see upr pdate ho
thanks sir
Thank u sir..
Thanks
Could you Make Algorithm series with Java
thanku bhai
Please sir make a video on roadmap for Artificial intelligence
bro make a vedio that is satisfied for all type of armstrong numbers
love you bruhhhh
👍🏼👍🏼👍🏼👍🏼👍🏼👍🏼
SIR I LOVE TEACHING method aap kaha se sir
thanks
kya bath hai😊
it's easy 👌
Please Share kr do 🙏🙏🙏
@@LearnCodingOfficial why don't you teach for n digits 😞
I recommend your channel to all my friend and now they said me that he didn't teach for n digits 😞😞😞
Please make a video for n digits
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
pls do it for any number of digits
Can we use math. Pow insted of multiplying it will be more easy
how calculate to the power n
Like 5^7 or 9^100 etc?
Sir, can share code for strong number with range....
Finally got a video with 0 dislike
What about 4,5,6....digit number.
This logic is not applicable for more than 3 digital numbers.
plz provide more than 3 digital number
Yes u r right
sir please tell my mistake I want to check how many armstrongs are there between 151 and 200
import java.util.Scanner;
class ams
{
public static void main(String[] args)
{
int re,x=0;
for(int n=151; n151)
{
re=n%10;
x=x+re*re*re;
n=n/10;
}
if(x==n)
{
System.out.println(n);
}
else
{
System.out.println(" this number is not armstrong");
}
}
}
}
My code is applicable to every numbers
Dear sir , from 1to 9 all numbers are armstrong number but here this code is not aplicable for 1 to 9.
I understand what you wrote in this prog i write same but there have under line all variable i can't understand what is the prob?
I show you image but in comment no option share image..Please hlp sir..
Aap ka har explanation easy to understand h...Mere liye samjh na bohat asan ho raha h...Keep it up sir,
Mera prob solve kar dijiye samaj me nahi a raha kya kare...
@@futureworld1807 kya problem hai bolo?
Armstrong no in between 1 to 500 ka vdo kijiye
sir but user can input any length of digit..how can u say its lenth is 3 only
eg:(rem*rem*rem)
sir but this program is only for 3 digit what if we have n digits in a number but like your explanation
Sir, please make a video on Rotating number like that 1234-...4123,3412
while(n>0)
{
rev=(rev*10)+ n%10;
n=n/10;
}
System.out.println(rev);
public static void main(String[] args)
{
System.out.println("enter a number");
int n ,z, rev=0;
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
// z=n;
while(n>0)
{
rev=(rev*10)+ n%10;
n=n/10;
}
s.o.p(rev);
Sir.. 2 is an armstrong number but your code prints that it is not..
Sir python program bhi skate.
Sir apka koi app h kya jha app paid course krate h aur interview ki taiyari
sir but if we give any other digit no. except three ,then this logic is not working....means for 4,5,6 digit no. this logic is not working
it is working
Bhai aplet ka video lovona
This program only work for 3 digit armstrong number not for 4 or 5 digit amstrong number
this logic is valid for only 3 digit numbers
Yes it's only for three digits. See the video of smart programming. Fir any number of digits
Yes you are right
Yes
No
Exactly I need a program for n digits
Any video suggestion
What about 4-digit number ArmStrong number. provide a solution to this
Related
import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner in=new Scanner(System.in);
int n=in.nextInt();
int p=n, q=n, count=0, check=0, value=n;
while(p!=0){
int rem=p%10;
count++;
p=p/10;
}
while(n!=0){
int rev=n%10;
check=((int)(Math.pow(rev, count))+check);
n=n/10;
}
if(check==value){
System.out.println(value+" is a Armstrong number");
}else
System.out.println(value + " is not a Armstrong number");
}
}
Bro agar no. Input liye he to kese pata chalega rem ko kitni bar multiple karna he( rem*rem*rem har program me 3 bar nahi kar skte na)
"1634 "is also a Amstrong number this code is not working for that input.
SIR JI 1634 is also armstrong number par yeh us par kaam nhi krega plzz pehle value count karke bnaiye
For 4 digit number!?
Hi ,it's working only for for 3digits numbers...
yes bhai
Variable could be A b c so as to make it clear.. else for me it's just a mess.
sir 1634 Armstrong no hai ya nahi
you choose 10 to find reminder why not choose another number???
because he splitting the numbers, that's why
What if the User Enters 4 digit number
Sir Armstrong 2 digit ka bhi hota hai???
no
Sir ...isme 10 se hi kyu divide kiya hai
what if I enter a 4 digit number does it still work?
No not working
what if the input is a 4 digit number?
import java.util.*;
public class Main
{
public static void main(String[] args) {
int n,arm=0,rem,d=0;
Scanner sc=new Scanner(System.in);
System.out.println("Enter the Number");
n=sc.nextInt();
while(n>0){
n=n/10;
d++;
}
int c=n;
while(n>0 )
{
rem=n%10;
arm=(rem*rem*rem)+arm;
n=n/10;
}
if(c==arm){
System.out.println("Armstrong number");
}
else
System.out.println("Not Armstrong number");
}
}
But what if the number is of more than 3 digits??
Why did you multiply three times, what ur user enter 4 digit number