La fonction rand (really i need your help )
dinaikram
Messages postés
1
Date d'inscription
Statut
Membre
Dernière intervention
-
anonymous -
anonymous -
Bonjour,
La fonction rand retourne un entier compris entre 0 et RAND_MAX de
manière aléatoire. Cette fonction se trouve dans la librairie stdio.h, et son
appel se fait comme ci après :
v1 = rand() % 100; // v1 in the range 0 to 99
v2 = rand() % 100 + 1; // v2 in the range 1 to 100
v3 = rand() % 30 + 1985; // v3 in the range 1985-2014
L’objectif :
1. Ecrire les fonctions :
- Remplir un tableau de N nombres aléatoires
- tri croissant
- tri décroissant
2. Ecrire le programme principale dans un fichier défirent de fichier
(fichiers) des fonctions réalisant le remplissage d’un tableau avec des
nombres aléatoires puis le tri à la demande.
La fonction rand retourne un entier compris entre 0 et RAND_MAX de
manière aléatoire. Cette fonction se trouve dans la librairie stdio.h, et son
appel se fait comme ci après :
v1 = rand() % 100; // v1 in the range 0 to 99
v2 = rand() % 100 + 1; // v2 in the range 1 to 100
v3 = rand() % 30 + 1985; // v3 in the range 1985-2014
L’objectif :
1. Ecrire les fonctions :
- Remplir un tableau de N nombres aléatoires
- tri croissant
- tri décroissant
2. Ecrire le programme principale dans un fichier défirent de fichier
(fichiers) des fonctions réalisant le remplissage d’un tableau avec des
nombres aléatoires puis le tri à la demande.
A voir également:
- La fonction rand (really i need your help )
- Fonction si et - Guide
- I showkeyplus - Télécharger - Utilitaires
- I deux point - Forum Windows
- Bouton on off o i - Forum Word
- I love pdf avis ✓ - Forum PDF