C programming
C programming

Write a c++ program to check a number is ARMSTRONG or not using the below mentioned class

Write a c++ program to check a number is ARMSTRONG or not using the below mentioned class

C programming
C programming

Write a c++ program to check a number is ARMSTRONG or not using the below mentioned class

 

//

//  main.cpp

//  ArmstrongNumber

//

//  Created by SHIVAM SINGH on 20/07/22.

//

#include <iostream>

using namespace std;

class Armstrong {

    int num;

    public :

    void input(int x) ;

    void checkARMSTRONG ( );

};

void Armstrong :: input(int x)

{

    num = x;

}

void Armstrong:: checkARMSTRONG()

{

    

    int x = num , temp , cube = 0;

    while ( x > 0 )

    {

        temp = x%10;

        cube  = cube + (temp*temp*temp);

        x = x/10;

    }

    if ( cube==num )

    {

        cout<<"Armstrong Number"<<endl;

    }

    else

    {

        cout<<"Not Armstrong Number"<<endl;

    }

}

int main() {

    Armstrong obj;

    obj.input(153);

    obj.checkARMSTRONG();

    

    return 0;

}

 

Topics Covered :

  • armstrong number
  • armstrong number in c
  • armstrong
  • armstrong number program in c
  • c program for armstrong number
  • armstrong program in c
  • c program for armstrong number with explanation
  • c program for armstrong
  • check if number is armstrong
  • c language
  • c programming lectures
  • gate c programming questions
  • c language lectures
  • c programming for gate
  • bigga rankin
  • vampire life
  • c programming
  • from orlando
  • fbmle

 


 

 


 

Thanks for reading this blog. Hope you get satisfied with the blog and definitely this blog must have valued your time and effort of reading.

Take a time to connect our other digital creations such as Instagram , Facebook and Youtube.

 

🧑‍💻🧑‍💻 Social Media Links of Tech DCode :

👉🏻 YouTube : https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A
👉🏻 Instagram : https://www.instagram.com/thetechdcode/
👉🏻 Facebook Page : https://www.facebook.com/thetechdcode
👉🏻 Twitter : https://twitter.com/thetechdcode
👉🏻 Telegram Channel : https://t.me/thetechdcode
👉🏻 Tech DCode Linktree : https://linktr.ee/thetechdcode
👉🏻 My Personal Handles : https://linktr.ee/virtualshivamin

🧑‍💻🧑‍💻 Social Media Links of SHIVAM SINGH (OWNER) :

👉🏻 Instagram : https://www.instagram.com/virtualshivamin/
👉🏻 Facebook Page : https://www.facebook.com/virtualshivamin/
👉🏻 Twitter : https://twitter.com/virtualshivamin/
👉🏻 Personal Linktree : https://linktr.ee/virtualshivamin 

 

Leave a Reply

Your email address will not be published. Required fields are marked *