Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include <conio.h>
- using namespace std;
- void wprowadzanieLiczb(int dane[6])
- {
- cout << "Podaj pierwsza liczbe: " << endl;
- cin >> dane[0];
- cout << "Podaj druga liczbe: " << endl;
- cin >> dane[1];
- }
- void przelicz(int dane[6])
- {
- dane[2] = dane[0] + dane[1];
- dane[3] = dane[0] - dane[1];
- dane[4] = dane[0] * dane[1];
- dane[5] = dane[0] / dane[1];
- }
- int wypiszWyniki(int dane[6])
- {
- cout << "Wynik dodawania \n" << dane[0] << " + " << dane[1] << " = " << dane[2] << endl;
- cout << "Wynik odejmowania \n" << dane[0] << " - " << dane[1] << " = " << dane[3] << endl;
- cout << "Wynik mnozenia \n" << dane[0] << " * " << dane[1] << " = " << dane[4] << endl;
- cout << "Wynik dzielenia \n" << dane[0] << " / " << dane[1] << " = " << dane[5] << endl;
- }
- int main()
- {
- int dane[6];
- wprowadzanieLiczb(dane);
- przelicz(dane);
- wypiszWyniki(dane);
- system("Pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement