Task - Armstrong and Special Number #10
Replies: 13 comments 6 replies
-
|
function armstrongNumber() { } |
Beta Was this translation helpful? Give feedback.
-
|
function armstrong() { } |
Beta Was this translation helpful? Give feedback.
-
|
let sum=0; number = prompt("Enter a number"); while(temp>0){ } if (sum==number){ } |
Beta Was this translation helpful? Give feedback.
-
| <script> const number = prompt("Enter a number"); const numberOfDigits = number.length; let sum = 0; // create a temporary variable let temp = number; while (temp > 0) { let remainder = temp % 10; sum += remainder ** numberOfDigits; // removing last digit from the number temp = parseInt(temp / 10); // convert float into integer } if (sum == number) { console.log(`${number} is an Armstrong number`); } else { console.log(`${number} is not an Armstrong number.`); } </script> |
Beta Was this translation helpful? Give feedback.
-
|
function Armstrong() |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
|
Task 2: } |
Beta Was this translation helpful? Give feedback.
-
|
let sum = 0; let temp = number; } if (sum == number) { |
Beta Was this translation helpful? Give feedback.
-
|
const number1 = prompt('Enter a First integer: '); function ArmNumFunc(num1){ |
Beta Was this translation helpful? Give feedback.
-
|
Task - Special Number `function factorialize(num) { function specialNumber() { }` |
Beta Was this translation helpful? Give feedback.
-
|
function armstrom() { |
Beta Was this translation helpful? Give feedback.
-
|
number=prompt("Enter the number"); |
Beta Was this translation helpful? Give feedback.
-
|
Hi Akash function fact(num1) } var numb1 = prompt('Enter the value of range'); result = isKrishnamurthy(parseInt(numb1)); if(result) kindly your help to find this issue. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
WAF to check if a number is an Armstrong number or not.
WAF to check if a number is a Special (Krishnamurthy) number or not.
Explanation:

Beta Was this translation helpful? Give feedback.
All reactions