Advertisement
Guest User

Untitled

a guest
Aug 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scilab 0.29 KB | None | 0 0
  1. clear
  2. //capturar numero
  3. numero=input("Introduce el numero: ")
  4. tope = numero - 1
  5. suma = 0
  6. for k = 1:tope
  7.     if(pmodulo(numero,k) == 0) then
  8.         suma = suma + k
  9.     end
  10. end
  11.  
  12. if (suma == numero) then
  13.     disp("Es un numero perfecto")
  14. else
  15.     disp("NO ES NUMERO PERFECTO")
  16. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement