#include<stdio.h>
      #include<math.h>
      int main()
      {
          printf("\n\n\t\tStudytonight - Best place to learn\n\n\n");
          int n,sum,i,t,a;
          printf("\n\n\nThe Armstrong numbers in between 1 to 500 are : \n\n\n");
          for(i = 1; i <= 500; i++)
          {
              t = i;  // as we need to retain the original number
              sum = 0;
              while(t != 0)
              {
                  a = t%10;
                  sum += a*a*a;
                  t = t/10;
              }
              if(sum == i)
              printf("\n\t\t\t%d", i);
          }
          printf("\n\n\n\n\t\t\tCoding is Fun !\n\n\n");
          return 0;
      }
      
      Apex language logo

      Armstrong

      0

      0

      avatar
      natalie19970

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.