Write the program form Armstrong no in c++?
Answers were Sorted based on User's Feedback
Answer / ankit,rohit
#include<stdio.h>
#include<conio.h>
void main()
{
int sum=0,n,m,i;
clrscr();
scanf("%d",&i);
n=i;
m=n;
while(n>0)
{
m=n%10;
sum=sum+(m*m*m);
n=n/10;
}
if(i==sum)
{
printf("the given number is amstrong");
else
printf("the given number is not amstrong");
}
getch();
}
| Is This Answer Correct ? | 20 Yes | 22 No |
What is a stack c++?
What is an orthogonal base class in c++?
How a new element can be added or pushed in a stack?
In which header file does one find isalpha() a) conio.h b) stdio.h c) ctype.h
In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?
Are c and c++ different?
What is searching? Explain linear and binary search.
How const functions will be treated by compiler?
Can you explicitly call a destructor on a local variable?
When we use Abstract Class and when we use Interface?where we will implement in real time?
Explain about Virtual Function in C++?
What is an adaptor class or wrapper class in c++?