Advertisement
Dushy

Exo6 TD_6

Oct 20th, 2015
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.45 KB | None | 0 0
  1. #include "Exo6.h"
  2.  
  3. void position(int const leTab[], int uneTaille, int unElement, int* punRang)
  4. { //version procedure
  5. int i;
  6.     if (uneTaille <= 0)
  7.     {
  8.         *punRang = -2;
  9.         return;
  10.     }
  11.     if (uneTaille == 1)
  12.     {
  13.         *punRang = 1;
  14.         return;
  15.     }
  16.     for (i = 0; i < uneTaille;i++;i++)
  17.         if (unTab[i]==unElement)
  18.         {
  19.             *punRang = i +1;
  20.             return;
  21.         }
  22.     *punRang = -1;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement