Advertisement
MaikeCristian

Untitled

Jan 18th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. <?php
  2.  
  3. echo '<meta charset="UTF-8">';
  4. echo"<pre>";
  5.  
  6. for ($i = 1; $i <= 50; $i++){
  7. $vetor[] = rand (1 , 100);
  8. }
  9. print_r($vetor); //ATE AQUI FUNCIONA
  10. $arr = 0;
  11. foreach($vetor as $arr => $posicao){
  12. if ($posicao % 2 ==0){
  13. echo "O $posicao na posicao $vetor é par";
  14. }
  15. }
  16.  
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement