Answer the question
In order to leave comments, you need to log in
How to determine if there is a remainder of a division in c++?
for example, we divide 5 by 2. there is a condition if (there is a remainder) ... then we do something. And the integer part of the division goes into another variable: variable=integer part(5/2)=2
how to do it?
Answer the question
In order to leave comments, you need to log in
const int a=5%2; //% - вычислить остаток от деления левого на правое
cout<<a;
In C++, the remainder of a division is determined by the % operator. For example:int a = 5 % 3;
Nik_Halker, read https://vk.com/doc268862046_361408455 and watch https://www.youtube.com/user/KennyMcKormic123/videos
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question