Advertisement
LucasVini

Calculadora 1.0 @LucasVinícius

Jan 30th, 2013
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.31 KB | None | 0 0
  1. /*========================== Créditos Gerais ===================================
  2.  
  3. @Developer: @LucasVinícius
  4.  
  5. @Simple Function: Gustavo Araújo
  6. */
  7. //MAINICON ICON "calculadora.ico" Colocar como Arquivo de RECURSO
  8. #include <stdio.h>
  9. #include <stdlib.h>
  10. #include <conio.h>
  11. #include <iostream>
  12.  
  13. int main()
  14.     {
  15.     system("TITLE Calculadora 1.0b © Copyright 2012 by @LucasVinícius All Rights Reserved");
  16.    
  17.     printf("\t\"Acesse: http://www.facebook.com/groups/323730837732320/\"\n");
  18.     printf("\n\nSejam Bem vindos a Calculadora\n\n");
  19.    
  20.     system ("color 0B");//Cor de Fundo preta e letras azuis brilhantes
  21.    
  22.     using namespace std;
  23.  
  24.     char operacao;
  25.     float numero1, numero2;
  26.  
  27.     cout << "Digite primeiro numero:  ";
  28.     cin >> numero1;
  29.  
  30.     cout << "Digite segundo numero:  ";
  31.     cin >> numero2;
  32.  
  33.     cout << "Informe a operacao ( +, -, *, /) ";
  34.     cin >> operacao;
  35.  
  36.     switch(operacao)
  37.     {
  38.         case '+': numero1 += numero2;
  39.         break;
  40.         case '-': numero1 -= numero2;
  41.         break;
  42.         case '*': numero1 *= numero2;
  43.         break;
  44.         case '/': numero1 /= numero2;
  45.         break;
  46.         default: cout << "\n\t Operador Invalido !!";
  47.     }
  48.  
  49.     cout << "\n Resultado: " << numero1 << "\n\n";
  50.  
  51.     system("PAUSE");
  52.     return 0;
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement