Fundamentos de Programação 1 - Alcides Maya Tecnologia
Fundamentos de Programação 1 - Alcides Maya Tecnologia
Fundamentos de Programação 1 - Alcides Maya Tecnologia
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Escola Alci<strong>de</strong>s <strong>Maya</strong> - Primeiro Módulo<br />
printf(“2 - subtracao\n”);<br />
printf(“3 - multiplicacao\n”);<br />
printf(“4 - divisao\n”);<br />
printf(“5 - Fim do programa\n”);<br />
printf(“escolha uma opcao: “);<br />
opcao = getch( );<br />
switch(opcao)<br />
{<br />
case ‘1’:<br />
somar( );<br />
break;<br />
case ‘2’:<br />
subtrair( );<br />
break;<br />
case ‘3’:<br />
multiplicar( );<br />
break;<br />
case ‘4’:<br />
dividir( );<br />
break;<br />
case ‘5’:<br />
printf(“\nencerrando o programa”);<br />
break;<br />
<strong>de</strong>fault:<br />
printf(“\nopcao invalida”);<br />
}<br />
printf(“\nPressione uma tecla para continuar”);<br />
getch( );<br />
}<br />
}<br />
somar( )<br />
{<br />
printf(“\nrotina <strong>de</strong> soma\n”);<br />
entrada( );<br />
result = valora + valorB;<br />
saida( );<br />
}<br />
subtrair( )<br />
{<br />
printf(“\nrotina <strong>de</strong> subtracao\n”);<br />
entrada( );<br />
result = valora - valorB;<br />
saida( );<br />
}<br />
74