Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- /*
- SKŁADNIA FUNKCJI
- typ_zwracany nazwa_funkcji([argumenty funkcji])
- {
- ciało_funkcji
- }
- */
- void wypisz_powitanie()
- {
- cout << "Hello world!\n";
- }
- int suma(int a, int b)
- {
- return a + b; // zwrócenie wartości
- }
- void wypisz_dzialanie_sumy(int a, int b)
- {
- cout << a << " + " << b << " = " << a + b << endl;
- }
- int main()
- {
- wypisz_powitanie(); // wywołanie funkcji
- cout << suma(10, 9) << endl;
- wypisz_dzialanie_sumy(17, 50);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement