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... 👌
*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"); } } }
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❤️!
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.
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...
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😝😂👍
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* .
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
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... 👌
*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");
}
}
}
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❤️!
Hey thanks... ur satisfaction means a lot to me😊
@@BTechComputerScience No worries🤭💗
CS sir with least technology you are best . Your explanation at each & step is amazing 😍. Keep it up ;
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.
Thank you so much ❤ please continue to do like these videos❤❤❤
Awesome bro…. 😊 it’s so clear
Detailed one..!! Great Thank you..!!
Excellent explanation😃
very easy steps ...thanks sir
u made my life very easy thankyou so much.
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...
Really glad u like it 😊
please copy the code in the comment session, it have some errors
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😝😂👍
😂👍
Thank you so munch...
Great work 👍
Hi sir you should initialize temp as double as math pow cant be in int data type
Yes correct!
Brother there we need to do explicit type conversion near applying power else we will get an lossy conversion error
Yes, students are smart and will figure it out😊, they won't like if I spoon feed everything!
Thanks for supporting!
How to do Brother??? Can You Please Explain
Thank you so much your videos helped me a lottttttt
Sir,make vdo on
Find a armstrong number btwn
2 numbers!
It was very helpful, thanks
Glad it was helpful 😊
Write a program add two number without using additional operator in java.
How to sir
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* .
Yes that's true, this is for beginner level, once u learn this, we can do it for any number of digits. Easy.
Tq alot bro....🥰🥰🥰🥰
Thank u soo much sir 🤝🤝🤝
please copy the code in the comment session, it have some errors
Pls give description of variables pls
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
Hey thanks for letting me know, I ll improve it
Sir ...plz how to generate random number par vedio banao ..
Very usefull you deserve a like
thanks bro
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
It's really great that u tried on your own and came up with great logic.😊
Sir akkada 153 number iccham kabatti math.(temp 3 ) ani pettaru but asalu ye number ivvakunda Armstrong aa kadha ani telusukovadam ela
i get error when i use math.pow conversion type error what to do now
Share the code, let me have a look
@@BTechComputerScience where to share it? Insta?
@@vishalrc6903 just copy paste the code in the comment
Error in
temp= math.pow(temp, 3);
pls help
It will typemissmatch
Try another method
Temp=(int)math.pow(temp,3) try this bro
everyone learning the program meanwhile me getting saced in 2am by hearing a brid sound 4:28😂
Thank you
Where is execution part?
Concept is Wrong, Pow(Num,Length) is right .
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
And why aren't you uploading videos these days
anna ,Armstrong number in a given range in java edhuku coding vanum anna pls video upload 😔pannunga
@3:05 so many mosquitoes my ears...
❤❤❤
What is about 1634
Armstrong we will get 308 so answer is not armstrong
why divided by 10 please any one explain
To get the Quotient i...e., 15
Error in
temp= math.pow(temp,3);
Pls help
Try importing this - import java.lang.Math;
@@BTechComputerScience kr diya import tb bhi error aarha pls help
@@mohammadsajid8924 if you have stored temp in int that can throw an error
type cast it : temp= (int) Math.pow(temp,3);
@@BTechComputerScience explanation: pow method returns a double so if your temp is not double, you need to type cast it
👍👍👍👍👍👍👍
sir plzz make video of palindrome number in java?
Watch my palindrome for strings video, a good coder like u can easily modify it for numbers 😊
How u fix ur cam frmd
it's a pretty messed up setup right now, previously I was using a phone holder like this one amzn.to/3ArD6YE
Thanks 🙏🏻
👍👏👏👏👏
Getting error at Math.pow line
Not like it
Too much complicated
Practice more, do more coding... then it might not seem very complicated!
thank you bro