0

/*for Armstrong i want to understand the logic please explain the program in hindi or English

/*for checking accor ding t the interval armstrong var a = Number(prompt ("enter the lower number" ) ); var b= Number (prompt ( " enter the higher number")); // yaha par apan counting chalayangel for (var i = a; i <= b; i++) { var temp = i; var no. of digit = i. to String length(); while (temp!= 0) { var digit = temp%10; var sum = Sum + no. of digit ***3; var temp = parseInt(temp/10); } if (sum == i ) : { console.log('"no. are Calculating are armstrong") } else { console .log("Not a valid armstrong); }

19th Aug 2022, 4:47 AM
Abhishek
Abhishek - avatar
3 Answers
0
Armstrong number : a number which sum of cube of individual numbers is equal to original number.. Ex: 153 = 1^3 + 5^3 + 3^3 = 1 + 125 + 27 = 153
19th Aug 2022, 8:35 AM
Jayakrishna 🇼🇳
0
Bhai mujhe program ki working bhi jaanni hai
19th Aug 2022, 8:37 AM
Abhishek
Abhishek - avatar
0
That program has lot of errors. It won't work.. First two lines takes input of 2 numbers.. Declaring variables in loop, causes each time redeclaration in loop so creates new values. Variables can't have special characters... Forget about the code.. Try to write code in your own logic . ...!!!...
19th Aug 2022, 2:45 PM
Jayakrishna 🇼🇳