Buckys C++ Programming Tutorials – 7 – Basic Arithmetic

[ad_1]
Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –


Posted

in

by

Tags:

Comments

42 responses to “Buckys C++ Programming Tutorials – 7 – Basic Arithmetic”

  1. Aravind Basmi Avatar

    How to get the exact float values in C++? I did 81/20 with float but it still gives me 4 as answer. Why is it so?

    could you please give me the notation for float values

  2. techmaster90 Avatar

    So is there a way to print the number and the remainder together using one variable?

  3. TumbleGamer Avatar

    why does the build log get angry when I use the x button to close the program.

  4. Geometry Dash Endermaster Avatar

    This is a programming tutorial not a 4th grade math tutorial, if you're gonna teach me math you should expect that I know how to do 7th grade math and below, maybe even some calculus.

  5. Diego Castillo Avatar

    These tutorials are wonderful! You did an amazing job!

  6. Murad Barlas Avatar

    very lovely tutorial i love the short and meaningful tutorial another channels are shit

  7. ZzZzZzZ zZzZzZzZz Avatar

    bidmas
    brackets
    indicies
    division
    multiplication
    addition
    subtraction

    also bodmass
    but i don't know what o stands for.

  8. Brian Lock Avatar

    why can't he just say follow the order of operation…..

  9. Arshan Ajmi Avatar

    what if i want to print 40.5

  10. Prodiigy • Avatar

    #include <iostream>

    Using namespace std;

    Int main( )
    {

    Int x = 81 /% 2;

    Cout << x;

    }

  11. Trey Avatar

    It's PEMDAS bucky and if it's like homework math it goes like this 1. Parentheses, 2. Exponents, 3. Multiplication & Division going from the left so if you have 3 * 8 / 2 you'd do it in the order you see so it'd be 12. 4, Addition and Subtraction in the same kind of from the left situation as multiplication and division! Please Excuse My Dear Aunt Sally or Please Excuse My Dumb Ass Sister whichever helps you memorize it more!

  12. p4r4d0x Avatar

    If the associate property part confuses you, I'll simplify it for you. You can easily understand it by using one word: PEMDAS. P = Parentheses, E = Exponents, M = Multiplication, D = Division, A = Addition, S = Subtraction.
    I'll give you an example and explain why the answer is the way it is.
    ex. (4 * 5) + 3[squared] * 534 / 4
    The answer is 1221.5
    The way we got it was using PEMDAS.
    Here is how to do it with PEMDAS (I'll show my work for you)
    (4 * 5) + 3[squared] * 534 / 4
    20 + 3[squared] * 534 / 4
    20 + 9 * 534 / 4
    20 + 4806 / 4
    20 + 1201.5
    1221.5
    First, we did the Parentheses, and got 20.
    Then, we solved the Exponent(2) of 3, and got 9.
    After that, we Multiplied 9 and 534, and got 4806.
    Next, we Divided 4806 by 4, and got 1201.5.
    Finally, we Added 20 and 1201.5, and got 1221.5.

    PLEASE NOTE: Parentheses(no matter where in the equation it is,) is done first, then the Exponent(s) are(is) done second (no matter where they or it is/are in the equation), then when we get to Multiplication and Division, if Multiplication is on the left side of the equation, it is done after that, BUT, if it is on the right side, and Division is on the left, the Division is done next, then the Multiplication is done after that, then we get to Addition and Subtraction, if the Addition is on the left side, the Addition is done next, BUT if it is on the right side, and the Subtraction is on the left, the Subtraction is done next. Also, if there is just Multiplication or just Division whichever one is the only one there, it will be done after Parentheses and Exponents, Also, if it is just Addition or Subtraction, whichever one is there will be done after the Multiplication and Division, BUT if there are not Exponents, or Parentheses, the Multiplication and or Division will be done next, and so on.. I think you get the point.

    I hope this helped! 😛

  13. Dead Channel R.I.P Avatar

    The way I learned it, Brackets first, then division, multiplication, addition, subtraction.

  14. Prodiigy • Avatar

    Addition (+)

    Subtraction (-)

    Multiplication (*)

    Divison (/)

    Get the remainder for division (%)

  15. Simon Elbæk Avatar

    I find it really funny how much the views drop as you get further into the tutorial.
    So many people who just thought "Man, this is not just about pressing the button that says 'create program'? Fuck it, I'm out"

  16. GronneVlog Avatar

    Made this program for fun, after watching this tutorial:

    cout << "what number do you want to be divided?: t";
    cin >> x;

    cout << "what number do you want to divide " << x << " with?: t";
    cin >> division;

    while (y != 0)
    {
    while (y != 0 && YOLO == 0) //set x % division = 0, so you can count how many times that it need to "overflow"
    {
    y = (x + z) % division; //find out when y = 0
    z++;
    //cout << y << " , " << z << " , " << x << endl;
    }

    y = (x + z) % division; //Findes y

    z++;
    z2++; //count how big y can become.
    YOLO++;
    }

    y = x % division; //Find the normal modulus to x

    y = y * (divideFactor / z2); //Find how many procent it is out of 1
    x = x / division; //finde the devides number

    cout << "The result is " << x << "." << y << endl;

  17. Paul Andrus Avatar

    FWIW, the associative property is related but different. You mean "algebraic order of operations." The acronym to remember the algebraic order of operations in PEMDAS for Parentheses, Exponents, Multiplication, Division, Addition, and Subtraction. The associative property says that (1 + 2) + 3 is the same as (2 + 3) + 1. For like operators, order does not matter.

  18. DoraxPLora Avatar

    I know math. Don't teach me math. I've come here to learn c++ SO FUKCING TEACH ME C++ U CHEECKY UCNT

  19. boris said Avatar

    it's not associative property, it's PEMDAS/ order of operatons

  20. MJ Sanchez Avatar

    You are a genius Bucky !!!

  21. ClickToAccept Avatar

    that moment he says "if u remember back to 7th grade math" yet your still in 7th grade LOL

  22. Arthur Tripp Avatar

    People forget that in pemdas multiplication doesn't always come before division its really whatever comes first in the problem from left to right. Same with addition and subtraction.

  23. rjhwinner03 Avatar

    Notice how the c++ terminal does not follow the order of operations at all haha

  24. mikesterism1998 Avatar

    it'
    s not the associative property, its order of operations.

  25. Erik Lu Avatar

    oh,,,you never reply me

  26. U. Thapa Avatar

    thank-you very much for all videos loved it

  27. GamingEnder Avatar

    One doubt i'm not in seventh but I like learning coding I have learnt the associative property in grade 6 (the grade I am in now) but by any chance does the computer use the Brackets Of Division Multiplication Addition Subtraction (BODMAS Method) ?

  28. Batman Avatar

    It's really same in every country In India it's BODMAS in UK it's BIDMAS in USA it's GEDMAS different name same meaning.

    Separated by lands united by maths 😀

  29. bor3y2 Avatar

    I learned Python from this guy and now i am learning C++. Thank you

  30. WillIsFriendly Avatar

    BIDMAS

    B = Brackets
    I = Indices
    D = Division
    M = Multiplication
    A = Addition
    S = Subtraction

  31. Mine Some Stone Gaming Avatar

    Thanks Bro for the these tutorials!

  32. Mine Some Stone Gaming Avatar

    The stuff he learned in 7 or 8 I learned in 5 or 6

  33. James W Avatar

    basically B.I.D.M.A.S in the UK
    Brackets ()
    Indices ^
    Division /
    Multiplication *
    Addition +
    Subtraction –

  34. FEDOR SYKORA Avatar

    LOL way back in seventh grade you say. I am starting seventh grade after this summer LEL!

  35. Braden Best Avatar

    Bucky, that's not the associative property. That's the order of operations, or in programmer jargon, operator precedence.

    The associative property is an observation of addition and multiplication that says the the same operation can be grouped in any way, and will still be the same.

    I.e. 3 + 7 + 5 will always be 15, no matter what you add first, and 2 * 3 * 5 will always be 30 regardless of which pair you multiplied first. This breaks down when different operations are happening in the same equation, which is where operator precedence and "terms" come in. Term being a word for one side of an addition (which includes its inverse — subtraction). E.g. 15x + 7 is two terms: 15x and 7.

    Assoc property does not cover an equation with more than one type of operation. So (15x) + 7 and 15(x + 7) mean two different things.

    Commutative property is the ability to re-order operations without consequence. 15 + 7 is the same as 7 + 15. To my knowledge, only addition and multiplication exhibit the commutative and associative properties. For example, 2^10 and 10^2 have wildly different outcomes: 1,024 and 100. So exponentation is not commutable. Further, (2^3)^2 and 2^(3^2) are also wildly different. 64 and 512, respectively. So it's not associable either.

    Distributive property says you can multiply terms together by distributing the multiplicand.

    5(x + 7) is the same as 5(x) + 5(7), or 5x + 35

    Factoring is doing that in reverse. E.g. in 5x + 35, both terms are divisible by 5, so it can be rewritten as 5(x + 7).

    That's algebra 101 folks.

  36. TheNaiveHoundoom Avatar

    It's called P.E.M.D.A.S, and I learned it in 5th grade. And I'm going into 6th. What's wrong with this picture?

  37. Rajyawardhan Singh Avatar

    that's also called B.O.D.M.A.S.

  38. Eshe Rienne Avatar

    I think the order of operations/associative property is learned in 5th or 6th grade, actually.

  39. White Fartt Avatar

    This shit is fun. This dude is fun. I'm learning so much. Sigh..you know he's good when you still comprehend at x2 speed. lol.

Leave a Reply

Your email address will not be published. Required fields are marked *