Step 1 : Start
Step 2 : Read Number
Step 3 : Temp = Number , Sum = 0 ,Power = 0
Step 4 : Compare Number with 0 , if Number > 0 then go to Step 5
else go to Step 7
Step 5 : Power = Power + 1
Step 6 : Number = Number / 10 ,then go to Step 4
Step 7 : Number = Temp
Step 8 : Compare Number with 0 , if Number > 0 then go to Step 9
else go to Step 12
Step 9 : Reminder = Number % 10
Step 10 : Sum = Sum + Reminder ^ Power
Step 11 : Number = Number / 10 ,then go to Step 8
Step 12 : if Sum = Temp then go to Step 13
else go to Step 14
Step 13 : print "Number is Armstrong" ,go to Step 15
Step 14 : print "Number is not Armstrong" ,go to Step 15
else go to Step 7
Step 5 : Power = Power + 1
Step 6 : Number = Number / 10 ,then go to Step 4
Step 7 : Number = Temp
Step 8 : Compare Number with 0 , if Number > 0 then go to Step 9
else go to Step 12
Step 9 : Reminder = Number % 10
Step 10 : Sum = Sum + Reminder ^ Power
Step 11 : Number = Number / 10 ,then go to Step 8
Step 12 : if Sum = Temp then go to Step 13
else go to Step 14
Step 13 : print "Number is Armstrong" ,go to Step 15
Step 14 : print "Number is not Armstrong" ,go to Step 15
Step 15 : Stop
No comments:
Post a Comment