Integer division and remainders using the modulus (%) operator (C++ programming tutorial)

preview_player
Показать описание
C++ Programming Tutorial: Integer division and remainders using the modulus (%) operator

Please support my work:
Every dollar is seriously appreciated and enables me to continue making more tutorials
Рекомендации по теме
Комментарии
Автор

I passed Mechanics of Materials with 4.0 last semester thanks to you and now I'm learning C++ from you. 😂 Thank you so much !

eeli
Автор

This is gold. So clear!. Thank you! Please do not ever delete this video.

anastaysiabroccoli
Автор

I've watched tons of tutorials about programming but your explanations are the best I've heard.Well done, mate !

guitarboy
Автор

Man it's so much easier to understabd when it's demonstrated in a video (atleast for me anyways).
I appreciate the help man. Great video.

_SubX_
Автор

اضحكتنى اول مره اشوف درس بشكل ده حقيقى ر ئع . تحيتى لك من مصر

fatmatawfik
Автор

Your explanations both the video and text example really made a difference in understanding this concept. One thing that I would add would have helped me get a quicker understanding would be to include this example as well.

EXAMPLE 1
in c# ( 41/11 = 3 ; // because c# is only interested in real numbers)
in normal math (41/11 = 3.727272)

to get modular of 41%11 do the following

(3 * 11) - 41 = 8 is the modular

EXAMPLE 2
in c# ( 505/13 = 38 ; // because c# is only interested in real numbers)
in normal math (41/11 = 38.8461)

to get modular of 505 % 13 do the following

(38 * 13) - 505= 11 is the modular

I am still learning so if I have anything that is wrong please let me know.

InayetHadi
Автор

awesome I'm glad to hear it! Check back later in the semester I am going to try to find time to finish a complete playlist on C++ soon

EngineerFree
Автор

Thank you for this video! I was having a hard time understanding my C++ teacher and you were able to clarify it in 5 minutes.

johniatrou
Автор

if i have 2 int varabile to divide to get float in c++ console exaple (average = sum / i )

zhaohanlui
Автор

this is very helpful, I found this when looking for how to divide integers, and i found that converting them to doubles is also quite helpful if you want a decimal value...
conversion works like this

double(24)/double(10) = 2.4

use double conversion for decimal division.

FaceSTAB
Автор

Congratulations, sir. This video earned you a subscriber.

garyreid
Автор

Wow helps me out alot. I think I know what to do for my assignment tomorrow now :)

jetswhiteout
Автор

WAP to input 2 numbers from user and print their sum, diffrence, product, division and modulus.tell me its answer.

AdityaKumar-gxey
Автор

If a five digits number is input through a keyboard write a c++ program to calculate the sum of the given digits.|

Note .. Use the modulus operator %
no use of array
The Number is 56822

5+6+8+2+2 = 23 you have to display something like this Dear Brother plz !!

roufisameer
Автор

forgive me but i'm very confused on this modulus business. if 10/2 = 2.5 then wouldn't the remainder be 0.5 and NOT 1? or if 18/5 = 3.6 then the remainder is 0.6 not 3?...

drtychez
Автор

how to make this in c program. ex. i input 12345 then the result is 12 thousands
3 hundreds
4 tens
5 ones

siegfredcane