0

A program for armstrong number

12th Sep 2017, 4:17 PM
Divyansh Kumar Singh
Divyansh Kumar Singh - avatar
3 odpowiedzi
+ 12
Algo : 1. Declare variables. 2. Enter a number. // n=153 3. Store it in another variable. // temp=n 4. Reverse the entered number: while(n!=0) { digit=n%10; rev=rev+(digit*digit*digit); n=n/10; } 5. if reverse of number == temp then Armstrong else not Armstrong
12th Sep 2017, 4:28 PM
P R
P R - avatar
12th Sep 2017, 4:25 PM
Dapper Mink
Dapper Mink - avatar
0
thanks­čśŐ­čśŐ­čśŐ­čśŐ
12th Sep 2017, 4:29 PM
Divyansh Kumar Singh
Divyansh Kumar Singh - avatar