Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int suma(int a, int b)
- {
- return a + b;
- }
- void funkcja()
- {
- cout << "ta funkcja cos wypisuje na ekran\n";
- }
- int main()
- {
- suma(10, 15); // funkcja została wywołana, ale nie wypisuje nic na ekran
- cout << suma(6, 7) << endl; // wynik działania funkcji jest wypisany na ekran (13)
- int wynik = suma(14, 5); // wynik działania funkcji jest zwrócony do zmiennej
- cout << wynik << endl; // wynik (który wziął swoją wartość z funkcji) zostaje wypisany na ekran (19)
- funkcja(); // funkcja nic nie zwraca, ale wypisuje tekst do konsoli
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement