Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  hw1
Language: PASCAL
Code:
program ch7_p225_5a;{choi hing ki 4d 08}
var x,y,z : integer;
procedure CheckArmstrong(N : integer; var Armstrong : Boolean);

begin                                             
x := N div 100;                                                            
y := N mod 100 div 10;               
z := N mod 10;                                                            

if x*x*x + y*y*y + z*z*z = N                                                  
then Armstrong := TRUE
else Armstrong := FALSE

end;
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
          
Comments: