35657

Untitled

Oct 21st, 2023
902
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. int main() {
  8.     setlocale(LC_ALL, "ru");
  9.     int a = 11;
  10.     int b = 3;
  11.  
  12.     cout << a % b << endl; // оператор деления по модулю (получение остатка от деления)
  13.  
  14.     cout << (a %= b) << endl; // оператор присваивания с делением по модулю
  15. }
  16.  
  17.  
Advertisement
Add Comment
Please, Sign In to add comment