Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.26 KB | None | 0 0
  1.  
  2. #include <cstdlib>
  3. #include <iostream>
  4. #include <iomanip>
  5. using namespace std;
  6.  
  7. void addNumbers()
  8. {
  9.     int a,b,s;
  10.    
  11.     cout<<"Prosthesi dyo arithmwn"<<endl<<"Dwste ton prwto arithmo:   ";
  12.     cin>>a;
  13.     cout<<endl<<"Dwste ton deutero arithmo:   ";
  14.     cin>>b;
  15.     s=a+b;
  16.     cout<<"Athroisma:  "<<s;
  17. }
  18.  
  19. void subtractNumbers()
  20. {
  21.     int a,b,s;
  22.    
  23.     cout<<"Afairesi dyo arithmwn"<<endl<<"Dwste ton prwto arithmo:   ";
  24.     cin>>a;
  25.     cout<<endl<<"Dwste ton deutero arithmo:   ";
  26.     cin>>b;
  27.     s=a-b;
  28.     cout<<"Diafora:  "<<s;
  29. }
  30.  
  31. void multiplyNumbers()
  32. {
  33.     int a,b,s;
  34.    
  35.     cout<<"Pollaplasiasmos dyo arithmwn"<<endl<<"Dwste ton prwto arithmo:   ";
  36.     cin>>a;
  37.     cout<<endl<<"Dwste ton deutero arithmo:   ";
  38.     cin>>b;
  39.     s=a*b;
  40.     cout<<"Ginomeno:  "<<s;
  41. }
  42.  
  43. void devideNumbers()
  44. {
  45.     float a,b,s;
  46.    
  47.     cout<<"Diairesi dyo arithmwn"<<endl<<"Dwste ton prwto arithmo:   ";
  48.     cin>>a;
  49.     cout<<endl<<"Dwste ton deutero arithmo:   ";
  50.     cin>>b;
  51.     s=a/b;
  52.    
  53.     cout<<"Piliko:  "<< fixed << setprecision(2)<<s;
  54. }
  55.  
  56. int main(int argc, char** argv) {
  57. addNumbers();
  58. cout<<endl<<endl;
  59. subtractNumbers();
  60. cout<<endl<<endl;
  61. multiplyNumbers();
  62. cout<<endl<<endl;
  63. devideNumbers();
  64.     return 0;
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement