Advertisement
Kacper_Michalak

Seria 2 Zadanie 9

Nov 7th, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.52 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int x,y;
  8.  
  9.     cout << "Podaj pierwsza liczbe: " ;
  10.     cin >> x;
  11.     cout << "Podaj druga liczbe: " ;
  12.     cin >> y;
  13.  
  14.     if ( x == 0 )
  15.     {
  16.         cout << "Nie mozna dzielic przez 0!" << endl;
  17.     }
  18.     else if ( y % x == 0)
  19.     {
  20.         cout << "Liczba druga liczba jest podzielna przez pierwsza." << endl;
  21.     }
  22.     else
  23.     {
  24.         cout << "Druga liczba nie jest podzielna przez pierwsza liczbe." << endl;
  25.     }
  26.  
  27.  
  28.  
  29.     return 0;
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement