SHARE
TWEET

Untitled

a guest Jan 21st, 2020 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //---------------------------------------------------------------------------
  2.  
  3. #pragma hdrstop
  4. #include<stdio.h>
  5. #include<conio.h>
  6. #include<time.h>
  7. //---------------------------------------------------------------------------
  8.  
  9. #pragma argsused
  10. int main(int argc, char* argv[])
  11. {
  12. int tableau[10] = {1,2,3,4,5,6,7,8,9,10};/*Taille du Tableau*/
  13. int VAL;
  14. int POS;
  15. int flag = 0;
  16. int i = 0,n;
  17.  
  18. printf("Taille du tableau:10\n");
  19. printf("Entrer une valeur:");
  20. scanf("%d",&VAL);
  21. while((flag != 1)&&(i<=n))
  22. {
  23. for(i=0;i<10;i++)
  24. {
  25.         if(tableau[i] == VAL)
  26.         {
  27.         printf("La valeur rentrer est dans le tableau\n");
  28.         POS = i;
  29.         flag = 1 ;
  30.         }
  31. }
  32. }
  33. printf("Voici la position de VAL:%d\n",POS);
  34. getch();
  35. return 0;
  36. }
  37. //---------------------------------------------------------------------------
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top