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 jobs can you get with a c++ certification?
When copy constructor can be used?
Explain register storage specifier.
Describe the main characteristics of static functions?
What do you mean by const correctness?
Differentiate between structure and class in c++.
Is multimap sorted c++?
What is do..while loops structure?
Difference between overloaded functions and overridden functions
what is smart pointer & use of the smart pointer ???
What is the purpose of the "delete" operator?
What is the C-style character string?