Saturday, 19 February 2011

Armstrong number program in java


Java code to check give number is Armstrong number or not



import java.io.*;




class Test {

     public static void main(String[] args) throws IOException {



          int num,r,sum=0,temp;

          System.out.println("Enter a number:-");

          BufferedReader br=new BufferedReader(new InputStreamReader (System.in));

          num=Integer.parseInt(br.readLine());

         

No comments:

Post a Comment