C++ Tutorial – 19 – The if else if else Statement

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


Posted

in

by

Tags:

Comments

33 responses to “C++ Tutorial – 19 – The if else if else Statement”

  1. alexandra Avatar

    Why can't you just use cascading if statements instead of 'else if'? What separates 'else if' from 'if'?

  2. Floris Heinen Avatar

    can you use an if statement with an char? for example: if(name ==bucky) {cout << "correct" << endl; }  else if(name != bucky) { cout << "sorry dude" << endl;} this doesnt work

  3. Job Q Avatar

    why if i include the do-while function,the program keeps on runnin? like 
    too high
    too high
    too high
    too high…. and its infinite..

  4. AgapiPistiElpida Avatar

    Thank you, so simple explained. Nice 🙂

  5. Syafiq Azman Avatar

    This video might be uploaded 6 years ago but you helped me a lot for school.
    Thanks! if you're still around that is.

  6. namit saxena Avatar

    I am Turbo C++ user so compiler varies :v :3

  7. Ben Dillon Avatar

    I get an elseif not declared in scope. What does that mean, and how do I fix it?

  8. Leen Kh Avatar

    how can i use this to make a random number guess. there was a previous program to do this but the so called 'random' number is allways the same! xD

  9. Dhruv Govil Avatar

    because it's easier to say "Do this if all my conditions have failed".
    Or ex: if (condition1 == true) { runThis(); } else { cout << "I'm running this for all other conditions" << endl; }

  10. bossman4pt0 Avatar

    If(answer >=1 && answer <=500)

  11. RequiemDestiny Avatar

    if(answer <= 500)

    I think, I'm not too sure, give it a try 🙂

  12. Ken Santos Avatar

    can i put a computation in the if else statement after the cout????is that possible?

  13. NoMoNeYiZaTioN Avatar

    Thanks Bucky, but what if I want a range of correct answers such as 1-500?

  14. Manuel Berlanga Avatar

    I feel like I'm so 2000 and late 🙁 lol.

  15. Travis Buchanan Avatar

    Um didn't you say that you are 23 in a couple previous videos??? or were these not made in order. Idk im watching this 5 years later and it really doesn't matter.

  16. stevedwild Avatar

    you need a cin line where the person can answer your question on whether or not they like bacon. Also it won't work b/c you declared that answer is "int" in line one which is an integer and "y" and "n" are not integers so your code will break

  17. Deadone Avatar

    When i type in ''else'' it say's '';'' expected before ''else''
    I put '';'' and it still say's the same thing,please help T.T

  18. BlackIceDds Avatar

    int answer
    cout << "Do you like bacon? (y or n)" << endl
    if (answer == y)
    cout << "You're cool, bro." << endl
    else
    cout << "You suck." << endl
    system("pause")
    return 0

  19. charburgX Avatar

    print "Why does everyone keep using coding languages?", "Oh crap! I'm using Python D:"

  20. Dunka Holics Avatar

    u explain better than my instructor.. i actually learned something.. thanks dude! ur awesome!

  21. Corey Doyle Avatar

    You are right, it actually didn't work for me when I combined them. Only when I changed it to execute the loop around the if's, without the 'do'.

    -Cheers

  22. RAHUL KUMAR S Avatar

    will the while condition executes till it is true or false? for example here it is executing till it gets false (answer!=21)

  23. Ace Avatar

    thats the devils no.

  24. Ivan Dominik Horvat Avatar

    "66..or 66… nah we don't want that" hahaha made me laugh 😀

  25. Magic Me Avatar

    Thank you so much! I have a test tomorrow and these videos are helping me out so much review wise.

  26. cheeze zlayer Avatar

    hey bucky i thought you said your 23 then your telling us your 21 haha just kidding bro! your great! nice job bucky the grappler

  27. McDucky Avatar

    cout<<"Silly You :P";

  28. Michy Tarol Avatar

    someone forget to put a question mark … haha

  29. FirstInstruMentalist Avatar

    noooo… gays work…its Mexicans that don't do shit

  30. TheGameCave Avatar

    curly braces? (or whatever they're called)

  31. xamuli Avatar

    @JerianMLG
    I think you're missing a semicolon somewhere. If you can't solve the problem yourself, I could try to solve it if you send the code for me with a private message.

Leave a Reply

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