Calculadora Em C++
Artigos Científicos: Calculadora Em C++. Pesquise 862.000+ trabalhos acadêmicosPor: victoresteves • 12/10/2013 • 2.421 Palavras (10 Páginas) • 485 Visualizações
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <iostream>
#include <fstream>
#include <ctype.h>
#define PI 3.14159265
main ()
{
char opcao;
float valor1,valor2,result;
printf("\n\t\xC9\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBB");
printf("\n\t\xBA\t C A L C U L A D O R A \t\xBA");
printf("\n\t\xC8\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBC\n");
printf("\n\n\n\t(+)SOMA\n\t(*)MULTIPLICACAO\n\t(-)SUBTRACAO\n\t(/)DIVISAO\n\t(E)EXPONENCIACAO\n\t(R)RAIZ QUADRADA\n\t(P)PORCENTAGEM\n\t(S)SAIR\n\n\tOPCAO: ");
opcao = getche();
//opcao = toupper (opcao);
//printf("%s teste");
switch(opcao){
case '+' :printf("\n\n\t S O M A\n");
printf("\n\t Digite o primeiro valor: ");
scanf("%f",&valor1);
printf("\n\t Digite o segundo valor: ");
scanf("%f",&valor2);
result= valor1+valor2;
printf("\n\n\t O VALOR DA SOMA %c: %.2f\n\n",130,result);break;
case '*':printf("\n\n\t M U L T I P L I C A C A O\n");
printf("\n\t Digite o primeiro valor: ");
scanf("%f",&valor1);
printf("\n\t Digite o segundo valor: ");
scanf("%f",&valor2);
result= valor1*valor2;
printf("\n\n\t O VALOR DA MULTIPLICACAO %c: %.2f\n\n",130,result);break;
case '-':printf("\n\n\t S U B T R A C A O\n");
printf("\n\t Digite o primeiro valor: ");
scanf("%f",&valor1);
printf("\n\t Digite o segundo valor: ");
scanf("%f",&valor2);
result= valor1-valor2;
printf("\n\n\t O VALOR DA SUBTRACAO %c: %.2f\n\n",130,result);break;
case '/':printf("\n\n\t D I V I S A O\n");
printf("\n\t Digite o primeiro valor: ");
scanf("%f",&valor1);
printf("\n\t Digite o segundo valor: ");
scanf("%f",&valor2);
result= valor1/valor2;
if(valor2==0){
printf("\n\t ERRO DIVISAO POR ZERO\n\n");
...