wap to check wether a number is armstrong or not between 100 to 999
1
Expert's answer
2013-04-03T10:33:16-0400
#include <iostream> #include <cmath>
using namespace std;
int main() { /* Check every 3-digit number abc * whether it's an armstrong number */ for (int a = 1; a <= 9; a++) for (int b = 0; b <= 9; b++) for (int c = 0; c <= 9; c++) if (pow(a, 3) + pow(b, 3) + pow(c, 3) == 100 * a + 10 * b + c) cout << a << b << c << endl; return 0; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment