Facebook
From Chocolate Capybara, 7 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 260
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int a;
  8.     int b;
  9.     cout << "podaj liczbe a"<<endl;
  10.     cin>>a;
  11.     cout << "podaj liczbe b"<<endl;
  12.     cin>>b;
  13.  
  14.     if( b!=0)
  15.     {
  16.         if ( a%b==0)
  17.         {
  18.             cout << "liczba " << a <<" jest podzielna przez "<< b<<endl;
  19.         }
  20.         else
  21.         {
  22.             cout <<"liczba " <<a<< " nie jest podzielna przez "<<b<<endl;
  23.         }
  24.     }
  25.     else
  26.     {
  27.         cout << "nie dzielimy przez zero!"<<endl;
  28.     }
  29. }
  30.