Answer Posted / sarang deshpande
#include<iostream.h>
#include<conio.h>
void main()
{
int n,n1,sum,rem;
clrscr();
cout<<" \n Enter a num ";
cin>>n;
n1=n;
sum=0;
while(n>0)
{
rem=n%10;
sum=sum+(rem*rem*rem);
n=n/10;
}
if(n1==sum)
{
cout<<"\n The number is armstrong "<<n1;
}
else
{
cout<<"\n The number is not armstrong "<<n1;
}
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is name hiding in c++?
What is guard code in c++?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
Explain the auto storage classes in c++.
What is namespace & why it is used in c++?
What is unary operator? List out the different operators involved in the unary operator.
Is C++ case sensitive a) False b) Depends on implementation c) True
What is the size of a vector?
Is it possible to write a c++ template to check for a function's existence?
what are the iterator and generic algorithms.
What are guid? Why does com need guids?
Can we make any program in c++ without using any header file and what is the shortest program in c++.
Can we make copy constructor private in c++?
Define a constructor - what it is and how it might be called (2 methods)?
How do you instruct your compiler to print the contents of the intermediate file showing the effects of the preprocessor?