0
I would like to use the switch case to choose which function will proceed with the program.
The program has 3 functions: a sum function, another multiplies and the last one is responsible for choosing which function the user will choose. Follows the excerpt from the program:
float escolhaFuncao (int escolha){
switch (escolha) {
case 1:
float SomaDigitos (float soma_A, float soma_B);
break;
case 2:
float Multiplicacao (float num1, float num2);
break;
default:
printf("numero nao permitido");
break;
}
return (escolha);
}
I do not know if this method is the most efficient, actually learning to work with functions, the program is flowing correctly, doing the sum and multiplication, just like to know which method I would use for the user to choose whether to use the function sum or function multiplication.
If you need me to post the complete code, let me know that I edit the post, I did not post soon because my doubt is only in this function.
Dude, I didn’t think of that, I’m gonna test the program with these changes and I’ll be back to let you know if I’ve succeeded
– Marcelo Henrique
I couldn’t, I’ll rewrite all the code and try again
– Marcelo Henrique
really didn’t work.
– Marcelo Henrique