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 & in c++ function?
What are the debugging methods you use when came across a problem?
Who calls main function?
What is microsoft c++ redistributable?
State the difference between pre and post increment/decrement operations.
What is nested class in c++?
When do we use copy constructors?
How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?
Explain selection sorting. Also write an example.
What is difference between class and structure in c++?
What do you mean by function and operator overloading in c++?
What is functions syntax in c++?