VOID

Résolu
langenoir7712 Messages postés 2 Date d'inscription vendredi 29 décembre 2000 Statut Membre Dernière intervention 17 décembre 2008 - 14 déc. 2008 à 16:23
cs_rt15 Messages postés 3874 Date d'inscription mardi 8 mars 2005 Statut Modérateur Dernière intervention 7 novembre 2014 - 17 déc. 2008 à 14:46
AIDER MOI SVP JE VEUX LE MEME PROGRAMME MAIS MTN AVEC UN VOID POUR NE PAS AVOIR TOUT CE BLABLA REPONDEZ MOI SVP
MERCI D'AVANCE

#include <stdio.h>
#include <math.h>
#include <conio.h>
int main()
    {
    float reponse;
    int i;
    i=1;
    char choix;
    printf ("********************************************************************************\n");        
    printf ("|1=addition|2=soustraction|3=multiplication|4=division|0=sortir|\n");
    printf ("\n");
    printf ("********************************************************************************\n");
                           int nb1,nb2;
                           nb1=0;
                           nb2=0;
                           printf("entrer nb1  : ");
                           scanf("%d",&nb1);
                           printf("entrer nb2 : ");
                           scanf("%d",&nb2);
                           printf ("\n");
   
           do
           {
           printf ("entrer votre choix : ");
           printf ("\n");
           choix=getch();
           switch (choix)
           {
                  case '1':
                           {
                           printf ("********************************************************************************\n");
                           printf ("vous avez choisi une addition\n");
                           reponse=nb1+nb2;
                           printf("la reponse est : %f  \n", reponse);
                           printf ("\n");
                           printf ("********************************************************************************\n");
                           i=0;
                           break;
                           }
                  case '2':
                           {
                           printf ("********************************************************************************\n");
                           printf ("vous avez choisi une soustraction\n");
                           reponse=nb1-nb2;
                           printf("la reponse est : %f  \n", reponse);
                           printf ("\n");
                           printf ("********************************************************************************\n");
                           i=0;
                           break;    
                           }
                  case '3':
                           {
                           printf ("********************************************************************************\n");
                           printf ("vous avez choisi une multiplication\n");
                           reponse=nb1*nb2;
                           printf("la reponse est : %f  \n", reponse);
                           printf ("\n");
                           printf ("********************************************************************************\n");
                           i=0;
                           break;
                           }
                  case '4':
                           {
                           printf ("********************************************************************************\n");
                           printf ("vous avez choisi une soustraction\n");
                           reponse=nb1/nb2;
                           printf("la reponse est : %f  \n", reponse);
                           printf ("\n");
                           printf ("********************************************************************************\n");
                           i=0;
                           break;   
                           }  
                  case '0':
                           {
                           printf ("********************************************************************************\n");
                           printf ("vous allez quitte le programme\n");
                           printf ("\n");
                           printf ("**************************************************************************\n");
                           i=1;
                           break;
                           }
              }
              }   
                   
    while (i==1);
    getch();
    }

langenoir7712
[mailto:leking7700@hotmail.com leking7700@hotmail.com]

7 réponses

cs_rt15 Messages postés 3874 Date d'inscription mardi 8 mars 2005 Statut Modérateur Dernière intervention 7 novembre 2014 13
14 déc. 2008 à 22:28
Salut,

Soit c'est moi, soit c'est incompréhensible...

VOID -> C'est le type VOID de windows ? Autre chose ?
3
Rejoignez-nous