Java program to find whether the given number is an Armstrong number

  Рет қаралды 6,769

QAFox

QAFox

Күн бұрын

Пікірлер: 9
@pl_777
@pl_777 8 ай бұрын
Great series ever for java program
@QAFox
@QAFox 8 ай бұрын
Thank you :) Note: Join our telegram group here - t.me/qafoxoriginal
@karthikeyanravi9840
@karthikeyanravi9840 Жыл бұрын
Sir, thank you so much this is exactly I was looking for. Loved your content! 😍
@QAFox
@QAFox Жыл бұрын
Most welcome!
@DeveshKumarprajapati-we4oi
@DeveshKumarprajapati-we4oi 8 ай бұрын
This program is not perfect because it will check only that number which is in between 100 to 999. To make this program perfect we have to count the digit and find the power of each digit with the help of count digit value. let's assume the number is 1234 then we have to calculate it like 1^4 + 2^4 + 3^4 + 4^4
@QAFox
@QAFox 8 ай бұрын
You can paste your better code here. Note: Join our telegram group here - t.me/qafoxoriginal
@DeveshKumarprajapati-we4oi
@DeveshKumarprajapati-we4oi 8 ай бұрын
@@QAFox Armstrong numbers between 1 and 10000 are: 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407, 1634, 8208, 9474 package Checker; import java.util.Scanner; public class Checker { public static void main(String[] args) { Scanner sc=new Scanner(System.in); //Taking user input...... System.out.println("Enter the number: "); int n=sc.nextInt(); sc.close(); //calling the method for checking armstrong number int sum=armStrong(n); //checking the condition if(sum==n) { //final output System.out.println(n+ " is ARMSTRONG number."); } else { //final output System.out.println(n+ " is not ARMSTRONG number."); } } //this method is going to count the number of digit in the given number public static int countDigit(int num) { int count=0; while(num>0) { num=num/10; count++; } //returning the number of digits return count; } public static int armStrong(int num) { int sum=0; //calling the method for counting the number of digit in given number and storing it.. int pow=countDigit(num); while(num>0) { int power=1; int rem=num%10; //loop for finding power for(int i=1;i
@Rakesh-le6mi
@Rakesh-le6mi 7 ай бұрын
Thank you sir
@TejendraPatel-wz2yk
@TejendraPatel-wz2yk 7 ай бұрын
If i Enter number with 6 digit?
Java program to find the factorial of the given number
8:49
Who’s the Real Dad Doll Squid? Can You Guess in 60 Seconds? | Roblox 3D
00:34
Wait for the last one 🤣🤣 #shorts #minecraft
00:28
Cosmo Guy
Рет қаралды 10 МЛН
Kluster Duo #настольныеигры #boardgames #игры #games #настолки #настольные_игры
00:47
А что бы ты сделал? @LimbLossBoss
00:17
История одного вокалиста
Рет қаралды 10 МЛН
07 - Java program to Check Armstrong Number
8:41
Software Testing And Automation
Рет қаралды 8 М.
Java Program #11 - Find Armstrong Number in Java
11:09
Programming For Beginners
Рет қаралды 23 М.
Java Program to find Prime Numbers Between 1 to 100
11:25
learnprograming byluckysir
Рет қаралды 37 М.
Armstrong Number | To check if a given number is an Armstrong number or not | Java
10:21
Frequently Asked Java Program 10: Generate Fibonacci series
9:50
Program to Check Armstrong Number in Java | Programming Tutorials
8:52
Programming Tutorials
Рет қаралды 873
Program To Check for Armstrong Number in Java by Deepak
16:11
Smart Programming
Рет қаралды 328 М.
Who’s the Real Dad Doll Squid? Can You Guess in 60 Seconds? | Roblox 3D
00:34