Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int podajLiczbe(void); //deklaracja funkcji
- void dzielenie(int, int); //deklaracja funkcji
- int main() {
- dzielenie(podajLiczbe(), podajLiczbe());
- return 0;
- }
- //Defnicja fukcji
- int podajLiczbe(void) {
- int a;
- cout<<"Podaj liczbe 1: ";
- cin>>a;
- return a;
- }
- void dzielenie(int a, int b) {
- if(b==0){
- cout<<"Blad, nie mozna dzielic przez 0"<<endl;
- } else {
- float c=float(a)/b;
- cout<<"Wynik to: "<<c<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement