Bonjour à tous,
toujours dans mes devoirs de programmations; là j'ai écrit un programme (qui compile pas) qui converti en entier en binaire ou octale en fonction du choix de l'utilisateur.
voici mon code, pouvez vous m'aider et me dire pourquoi il veut pas compiler.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
 
 
#include<stdio.h>
#include<stdlib.h>
  /* la fonction de conversion en binaire*/
    int binaire(int nbr){
    int t[10];
    int i=0;
    int k=0;
    do{
    t[i]=nbr%2;
    nbr=nbr/2;
    i++;
    k++;
    }
    while(nbr!=0);
    printf("\nla conversion en binaire est: ");
    for(i=k-1;i>=0;i--){
    printf("%d",t[i]);
    }
    }
 
    /* la Fonction de conversion en octal*/
    int octale(int nbr){
    int t[10];
    int i=0;
    int k=0;
    do{
    t[i]=nbr%8;
    nbr=nbr/8;
    i++;
    k++;
    }
    while(nbr!=0);
    printf("\nla conversion en octale est: ");
    for(i=k-1;i>=0;i--){
    printf("%d",t[i]);
    }
    }
int main()
 {
    int choix,nbr;
 
 
 
    printf("entrez un nombre: ");
    scanf("%d",&nbr);
    do
    {
        printf("\n-------------------------LA LISTE DES CHOIX------------------------");
        printf("\n 1---->Convertion d'un decimale vers BINAIRE.");
        printf("\n 2---->Convertion d'un decimale vers OCTALE.");
 
        printf("\nchoix: ");
        scanf("%d",&choix);
 
        switch(choix)
        {
            case 1:
            printf("Veuillez saisir le nombre a convertir en binaire: ");
            scanf("%d",&nbr);
            binaire(nbr);
 
            break;
            case 2:
            printf("Veuillez saisir le nombre a convertir en octale: ");
            scanf("%d",&nbr);
            octale(nbr);
 
            break;
        }
 
 
        return 0;
    }
 }
Code Blocks me retourne le message d'erreur suivant :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
/home/sk8trasher/Dropbox/EDUCATEL/DEVELLOPEMENT_APPLICATION_C/Devoir_3/dev3ex2ab.c||In function ‘main’:|
/home/sk8trasher/Dropbox/EDUCATEL/DEVELLOPEMENT_APPLICATION_C/Devoir_3/dev3ex2ab.c|74|erreur: expected ‘while’ before ‘}’ token|
/home/sk8trasher/Dropbox/EDUCATEL/DEVELLOPEMENT_APPLICATION_C/Devoir_3/dev3ex2ab.c|74|erreur: expected declaration or statement at end of input|
||=== Build finished: 2 errors, 0 warnings ===|

Je vous remercie de l'éclairage qui vous pourrez m'apporter.
Merci