Skip to main content
Search
Search This Blog
Livecodo
Pages
Home
Courses
Blog
About us
More…
Share
Get link
Facebook
X
Pinterest
Email
Other Apps
April 10, 2024
Java program to check Armstrong number
import java.util.*; public class arm { public static void main(String[] args) { Scanner n=null; int a,b=0,c,d; n=new Scanner(System.in); System.out.println("enter"); a=n.nextInt(); for(c=a;a>0;a=a/10) { d=a%10; b=(d*d*d)+b; } if(c==b) System.out.println("yes"); else System.out.println("no"); } }
Popular Posts
March 26, 2024
Dynamic Memory allocation in C
May 18, 2024
Searching and sorting Algorithm in C