Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * exo3.c
- *
- * Created on: 26 nov. 2015
- * Author: omarou
- */
- void saisiechiffre (char *tab[],int *nb) {
- do {
- printf("Nombre entre 1 et 7 : ");
- scanf("%d",nb);
- if (*nb<1 || *nb>7) printf("%s",tab[0]);
- } while (*nb<1 || *nb>7);
- }
- void affichejour (char *tab[],int nb) {
- printf("%d -> %s\n",nb,tab[nb]);
- }
- int main () {
- int nb;
- char *tabjour[] = {"Erreur : chiffre incorrecte\n","Lundi","Mardi","Mercredi","Jeudi","vendredi","Samedi","Dimanche"};
- saisiechiffre(tabjour,&nb);
- affichejour(tabjour,nb);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement