Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Program Calculadora ;
- var v1,v2,t : real;
- op : char;
- Begin
- write ('Entre com o primeiro valor: ');
- readln (v1);
- write ('Entre com o segundo valor: ');
- readln (v2);
- write ('Escolha a operação: + - * / ');
- readln (op);
- case (op) of
- + : t:= v1+v2;
- - : t:= v1-v2;
- * : t:= v1*v2;
- / :
- begin
- if v1/0 = 0 then
- write
- ('Expressão incorreta!');
- else
- t:= v1/v2;
- writeln ('Resultado: ',t);
- end;
- else
- write('O operador informado é inválido!');
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement