garfield

[COD]: Verificar se o número é par.

Jul 25th, 2011
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.36 KB | None | 0 0
  1. /*
  2.     @projectName: IsParNumber
  3.     @projectsintax: Pawn/Pawno
  4.     @projectfunc: Verifica se o número é par.
  5.     @projectCredits: [iPs]Garfield / SuYaNw
  6. */
  7.  
  8.  
  9. #define IsParNumber(%0) !((%0)%(2))
  10.  
  11.  
  12. // teste:
  13. public OnFilterScriptInit()
  14.     new e;
  15.     while(e <= 10)
  16.     {
  17.         if(IsParNumber(e))
  18.         {
  19.             printf("%d é par", e);
  20.         }
  21.         ++e;
  22.     }
  23.     return true;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment