спасти мать-природа.

мы не нужны деньги. мы просто с просьбой помочь

Сохранить Землю. Просто быть частью понимания. Прогулка больше, делать менее использование автомобиля. Хотя, как это только увидеть и попробовать все возможное,

See Here, we are not asking for money.

пожалуйста, сохраните прекрасную землю пожалуйста, нажмите здесь(please Help Us)

Saturday, 6 July 2013

Armstrong Program

    class Armstrong
    {
        public static void main(String args[])
        {
            int arm=153;
            int no=0;
            int n;       
            int temp=arm;

            while(arm>=0)
            {
                n=arm%10;
                no=no+(n*n*n);
                arm=arm/10;                       
            }
            System.out.println(no);
            if(temp==no)
                System.out.println(temp+" is an armstrong number");   
            else
                System.out.println(temp+" is not an armstrong number");
        }
    

No comments:

Post a Comment

Thank you....

Note: only a member of this blog may post a comment.