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 the use of function pointer?
What's the hardest coding language?
When do we run a shell in the unix system? How will you tell which shell you are running?
What do you mean by ‘void’ return type?
In a function declaration what does extern means?
What is oops in c++?
How do you print for example the integers 3,2,1,5,4 in a binary tree within the console in format where it looks like an actual binary tree?
What is the use of class in c++?
diff between pointer and reference in c++?
What is the difference between a type-specific template friend class and a general template friend class?
What are separators in c++?
What does std :: flush do?