C++

C++ Program to Check Prime and Armstrong Number

In this example, two user-defined functions checkPrimeNumber() and checkArmstrongNumber()are created.




The checkPrimeNumber() returns 1 if the number entered by the user is a prime number.

Similarly, checkArmstrongNumber() returns 1 if the number entered by the user is an Armstrong number.

C++ Code:

Output:

About the author

admin

Leave a Comment