Atps Programacao Estruturada 1
Ensaios: Atps Programacao Estruturada 1. Pesquise 862.000+ trabalhos acadêmicosPor: arkeiro15 • 18/11/2013 • 1.548 Palavras (7 Páginas) • 308 Visualizações
#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
char op;
int num1,num2,bas,exp,res;
float val1,val2,res2;
while (1) {
system("cls");
printf("\t\xC9\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xCD\xBB\n");
printf("\t\xBA C A L C U L A D O R A\xBA\n");
printf("\t\xC8\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("\t(+) - Soma\n");
printf("\t(-) - Subtracao\n");
printf("\t(*) - Multiplicacao\n");
printf("\t(/) - Divisao\n");
printf("\t(E) - Exponenciacao\n");
printf("\t(R) - Raiz Quadrada\n");
printf("\t(P) - Porcentagem\n");
printf("\t(S) - Sair\n");
printf("\tOpcao: ");
op = getche();
switch (op)
{
case '+' : printf("\n\n\t\t S O M A \n");
printf("\n\t Digite o primeiro valor: ");
scanf("%d",&num1);
printf("\t Digite o segundo valor: ");
scanf("%d",&num2);
res= num1+num2;
printf("\n\t %d+%d = %d \n",num1,num2,res);
break;
case '-' : printf("\n\n\t\t S U B T R A C A O \n");
printf("\n\t Digite o primeiro valor: ");
scanf("%d",&num1);
printf("\t Digite o segundo valor: ");
scanf("%d",&num2);
res= num1-num2;
printf("\n\t %d-%d = %d \n",num1,num2,res);
break;
case '*' : printf("\n\n\t\t M U L T I P L I C A C A O \n");
printf("\n\t Digite o primeiro valor: ");
scanf("%f",&num1);
printf("\t Digite o segundo valor: ");
scanf("%f",&num2);
res= num1*num2;
printf("\n\t %d * %d = %d \n",num1,num2,res);
break;
case '/' : printf("\n\n\t\t D I V I S A O \n");
printf("\n\t Digite o primeiro valor: ");
...