- include < stdio.h>
int type_operation;
double premier, second;
float resultat(float premier,float second, int type_operation)
{
if ( type_operation == 1)
{
return(premier + second);
}
if ( type_operation == 2)
{
return(premier - second);
}
if ( type_operation == 3)
{
return(premier * second);
}
if ( type_operation == 4)
{
return(premier / second);
}
}
void main()
{
printf("\t\t\t\t- CALCULATRICE -\n\n");
printf("Veuillez tapez un nombre : " );
scanf("%lf",&);
printf("\n\n- Veuillez choisir le type de votre operation :\n");
printf("\t- 1 : Addition\n");
printf("\t- 2 : Soustraction\n");
printf("\t- 3 : Multiplication\n");
printf("\t- 4 : Division\n");
printf("Votre choix : " );
scanf("%d",&_operation);
do
{
printf("Votre choix : " );
scanf("%d",&_operation);
} while ( type_operation < 1 || type_operation > 4);
printf("\n\nVeuillez tapez un votre deuxieme nombre : " );
scanf("%lf",&);
printf("\n\nLe resultat de l´operation est %lf\n", resultat(premier, second, type_operation));
}
ça c´est mon programme que j´ai rendu aux partiels 