Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---------------------------------------------------------------------------
- #pragma hdrstop
- #include<stdio.h>
- #include<conio.h>
- #include<time.h>
- //---------------------------------------------------------------------------
- #pragma argsused
- int main(int argc, char* argv[])
- {
- int tableau[10] = {1,2,3,4,5,6,7,8,9,10};/*Taille du Tableau*/
- int VAL;
- int POS;
- int flag = 0;
- int i = 0,n;
- printf("Taille du tableau:10\n");
- printf("Entrer une valeur:");
- scanf("%d",&VAL);
- while((flag != 1)&&(i<=n))
- {
- for(i=0;i<10;i++)
- {
- if(tableau[i] == VAL)
- {
- printf("La valeur rentrer est dans le tableau\n");
- POS = i;
- flag = 1 ;
- }
- }
- }
- printf("Voici la position de VAL:%d\n",POS);
- getch();
- return 0;
- }
- //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement