Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program testandoWhile;
- var
- opcao:integer;
- total:real;
- numero:real;
- numeroDois:real;
- begin
- // Programa para multiplicar e dividir em While //
- write('Digite 0 para sair, 1 para multiplicar e 2 para dividir.');
- read(opcao);
- while ( opcao <> 0 ) do
- begin
- if( opcao = 1) then
- begin
- write('Digite o numero para multiplicar.');
- readln(numero);
- write('Digite o segundo numero.');
- readln(numeroDois);
- total := (numero*numeroDois);
- write('Total: ', total);
- readln(opcao);
- end
- else if (opcao = 2) then
- begin
- write('Digite o numero para dividir.');
- readln(numero);
- write('Digite o segundo numero.');
- readln(numeroDois);
- total := (numero/numeroDois);
- write('Total: ', total);
- readln(opcao);
- end;
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment