Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int MAX(int l1,int l2,int l3)
- {
- if(l1>l2&&l1>l3)
- {
- return l1;
- }
- else if(l2>l1&&l2>l3)
- {
- return l2;
- }
- else
- {
- return l3;
- }
- }
- int main()
- {
- int liczba1;
- int liczba2;
- int liczba3;
- cout << "Podaj pierwsza liczbe naturalna: ";
- cin >> liczba1;
- cout << "Podaj druga liczbe naturalna: ";
- cin >> liczba2;
- cout << "Podaj trzecia liczbe naturalna: ";
- cin >> liczba3;
- std:cout<<"Najwieksza z podanych liczb to: "<<MAX(liczba1,liczba2,liczba3);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement