Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define NBINT 7
- int main()
- {
- int tab[NBINT]={9,5,1,4,2,10,2};
- int NbTemp,j,i;
- for(i=0;i+1 < NBINT;i++)
- {
- for(j=i+1;j<NBINT;j++)
- {
- if(tab[i] > tab[j])
- {
- NbTemp=tab[i];
- tab[i]=tab[j];
- tab[j]=NbTemp;
- }
- }
- }
- printf(" le premier min est %d \n",tab[0]);
- printf(" le deuxieme min est %d \n",tab[1]);
- getch();
- return 0;
- }
Add Comment
Please, Sign In to add comment