Answer Posted / 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 |
Post New Answer View All Answers
What is the difference between global int and static int declaration?
What is an accessor in c++?
Write a Program for dynamically intialize a 2 dimentional array. Eg:5x20, accept strings and check for vowels and display the no.finally free the space allocated .
When do you call copy constructors?
What ANSI C++ function clears the screen a) clrscr() b) clear() c) Its not defined by the ANSI C++ standard
Will the following program execute?
Is c++ built on c?
Which is best c++ or java?
Is c++ slower than c?
Write a program to encrypt the data in a way that inputs a four digit number and replace each digit by (the sum of that digit plus 7) modulus 10. Then sweep the first digit with the third, second digit with the fourth and print the encrypted number.
Do you know about latest advancements in C++ ?
Is c++ map a hash table?
Write a program which employs Recursion
Differentiate between a constructor and a destructor in c++.
What is #include iostream h in c++?