1.Between 100 and 999 are some numbers that have the
characteristics that if you cube the individual digits and
sum together you will get the same number.
2. A program that can accept as input an integer and output
the equivalent of that number in words.
Answer Posted / leosoft
#include<stdio.h>
#include<math.h>
int a,b,c;
int main()
{
for(a=0;a<=9;a++)
{
for(b=0;b<=9;b++)
{
for(c=0;c<=9;c++)
if ((a*a*a)+(b*b*b)+(c*c*c)==(100*a)+(10*b)+(c))
printf("\nThe Numbers are :%d",(100*a)+(10*b)+(c));
}
}
return 0;
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is the equivalent of Pascal's Real a) unsigned int b) float c) char
Using a smart pointer can we iterate through a container?
Which is better c++ or java?
What is the difference between a "copy constructor" and an "assignment operator" in C++?
What data encapsulation is in c++?
Is there a sort function in c++?
Explain how would you handle a situation where you cannot call the destructor of a local explicitly?
Explain the difference between c & c++?
What is difference between n and endl in c++?
What do you mean by stack unwinding in c++?
What is the use of seekg in c++?
Why are pointers used?
What is data abstraction? How is it different from data encapsulation?
Differentiate between a constructor and a method in C++.
Write a code/algo to find the frequency of each element in an array?