Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. float a,b;
  6.  
  7. void Pod2liczb(void)
  8. {
  9. cin>>a;
  10. cin>>b;
  11. }
  12.  
  13. void dodaw(void)
  14. {
  15. cout<<"Wynik dodawanie to: ";
  16. cout<<a+b<<endl;
  17. }
  18.  
  19. void odejm(void)
  20. {
  21. cout<<"Wynik odejmowania to: ";
  22. cout<<a-b<<endl;
  23. }
  24.  
  25. void mnoze(void)
  26. {
  27. cout<<"Wynik mno¿enia to to: ";
  28. cout<<a*b<<endl;
  29. }
  30.  
  31. int dziele()
  32. {
  33. if(a!=0)
  34. {
  35.  
  36. cout<<"Wynik dzielenia to: ";
  37. cout<<a/b<<endl;
  38. }
  39. else
  40. {
  41. cout<<"Error, nie mo¿na dzieliæ przez 0"<<endl;
  42. return 0;
  43. }
  44. }
  45.  
  46. int rzdzi()
  47. {
  48. int c,d;
  49. c=a;
  50. d=b;
  51. if((c>0) && (d>0))
  52. {
  53.  
  54. cout<<"Wynik reszty z dzielenia to: ";
  55. cout<<c%d<<endl;
  56. }
  57. else
  58. {
  59. cout<<"Error, liczby musz¹ byæ wiêksze od 0"<<endl;
  60. }
  61. return 0;
  62. }
  63.  
  64. int main()
  65. {
  66. Pod2liczb();
  67. dodaw();
  68. odejm();
  69. mnoze();
  70. dziele();
  71. rzdzi();
  72. cout<<"--------------------------------"<<endl;
  73. return main();
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement