Get Off-Campus Placement Jobs Info !!!
Programs asked in Mettl Coding Round
Click To Practce List of Programs asked in Nagarro !!!

Program Discussion :: Basics

Home > Programs > Basics

68 / 248

Write a program to check Armstrong number.

Answer:

#include 
#include 
# include 
using namespace std; 
void main()
{
    int number, sum = 0, rem = 0, cube = 0, temp; 
    cout number;
    temp = number;
    while (number != 0)
    {
        rem = number % 10;
        cube = pow(rem, 3);
        sum = sum + cube;
        number = number / 10;
    }
    if (sum == temp)
       cout 

Asked In :: Wipro Syntel Inc.

Post Your Answer Here:

Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here: