Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. //definicja funkcji
  6. int funkcja1()
  7. {
  8. int x=3, y=10;
  9. int suma=x+y;
  10. return suma;
  11. }
  12. void funkcja2()
  13. {
  14. int x=3, y=10;
  15. int suma=x+y;
  16. cout<<suma<<endl;
  17. }
  18. int funkcja3();
  19. int funkcja4(int x, int y)
  20. {
  21. int suma=x+y;
  22. return suma;
  23. }
  24. void funkcja5(int x, int y)
  25. {
  26. cout<<x+y<<endl;
  27. }
  28.  
  29. int main()
  30. {
  31. //wywolanie funkcji
  32. cout<<"Wynik sumowania wynosi "<<funkcja1()<<endl;
  33. cout<<"Wywolanie funkcja2 ";
  34. funkcja2();
  35. cout<<"Wywolanie funckja3 "<<funkcja3()<<endl;
  36. cout<<"Wywolanie funckja4 "<<endl;
  37. int a,b;
  38. cout<<"Podaj liczby: "<<endl;
  39. cin>>a>>b;
  40. cout<<funkcja4(a,b)<<endl;
  41. cout<<funkcja4(100,-25)<<endl;
  42. funkcja5(a,b);
  43. return 0;
  44. }
  45. funkcja3()
  46. {
  47. int x=3, y=10;
  48. int suma=x+y;
  49. return suma;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement