📚 Learn how to solve problems and build projects with these Free E-Books ⬇️ C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook 🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/ Experience the power of practical learning, gain career-ready skills, and start building real applications! This is a step-by-step course designed to take you from beginner to expert in no time! 💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10). Use it quickly, because it will be available for a limited time.
This is a very nice video. Just one more thing. We should first check if A+B>C && B+C>A && A+C>B so to have a valid triangle. (For example 2 3 7 is not a triangle). As for the method of teaching, it is excellent!
After bouncing my head off a bunch of tutorials in the past and ultimately giving up I'm glad I found your channel! the ascii video and you challenging me to decipher it helped so much, but now moving on to these next few videos and having a visual laid out, it's just absolutely clicked with me. I feel like I'm on a roll, I even filled out the nested bit before you even explained how to do it! You are a fantastic teacher, I can't believe these are free. Most definitely subbed.
Pozdrav Saldina, za ovaj tutorijal (kao i za tvoj kanal istovremeno) sam saznala tako sto nam ga je preporucio profesor C++ sa Floride . Bravo devojko! 😊
Ok after all this work. I found you have to enter the lengths only separated by spaces. Seems like someone on here could have given me a heads up or something. Thanks for the troubleshooting experience. I keep gettting Scalene so I added a check at the end to see what a b c was. Fixed sort of. This was the output: a, b, c7,7,7 Scalene Triangle 7 0 4.59163e-41. So why is this happening? I was able to get it working only by getting the lengths 1 at a time. This the code I got to work: #include using namespace std; int main() { float a,b,c; //variables float aside, bside, cside; //enter side a cout
i was following and not to complete to the end of the line and try to do it my self, it was very helpful and literally just after you wrote if (a == b && b == c) { cout
Great video! I'm writing from Italy and here we're taught that equilateral triangles are a subclass of isosceles triangles. I'm surprised that you follow Euclid's thinking (isosceles triangles have two AND ONLY two sides of equal length): may I ask you if that was a choice to simplify the video or indeed you have that difference in mind?
You can use as many as you need - your program is going to work. But, after some time (three or four if/else-s) it becomes kinda hard to read, and instead of adding more if-s and else-s better solution would be to use "switch/case" (if that is possible of course) If/else is often better for checking expressions that result as bool values, whereas switch/case is used if you have other data values (numbers, characters, etc.) In if/else statement, you are going to decide whether to execute if or else block, but in switch/case you decide which case you are going to execute. In this playlist, you can find an example of how to use switch/case and build a calculator app. That video would give you pretty good idea of how switch/case is used.
@@CodeBeauty Thanks mate, Not many creators offer such in-depth explanations to questions asked, you are truly unique in this. Thanks for putting the fun back into learning :)
Thank you so much for this series, I have just started a degree in software engineering, and have been struggling with my lecturer's teaching style, I was ready to give up. These tutorials have literally saved my faith in my ability as I actually understand you and your explanations. Thank you!! One thing, I believe I have copied this code exactly as it appears here, yet I keep getting "scalene" no matter what numbers I enter into the program. What do you think I could have missed that is causing this?
@@Stoogette87 No problems, and please don't feel silly - this is part of learning to code: try some stuff, and if it doesn't work then try something different. :D
Great video! I have a question though, is there a way to connect the else to it's respective if? I'm currently finding myself using multiple nested statements (right now I have 2 if elses inside another one) and it's easy to connect the 1st and 3rd elses but the 2nd one seems to always get an "expected expression" error. PS I know this probably isn't the best way of doing this, Im just starting out.
learning so much from you. it is giving me the confidence to experiment with programming. I hope you don't mind but I have changed your example just to see if I can actually get it to work.....what do you think of the result? #include using namespace std; int main() { repeatme: // allows program to reset from this point // user enters lengths of a triangle (a,b,c) // program should output whether the triangle is equilateral, isoscelese or scalene float a, b, c; cout > a; cout > b; cout > c; cout
I think it would work also if we used the (if - else if - else) statement, wouldn't that be easier than a nested if-else statement? And thank you so much for the video, I believe your channel has saved my university future in Computer Science. Muchas gracias
Yes, this can be written as: if(a==b && b==c) ..equilateral else if (a!=b && a!=c && b!=c) ..scalene else ..isosceles I plan to publish tutorials for a long time, so there will be a lot of things to study on this channel. 🤓
// Can you help me please. when i start the program and enter a b or c all i get is isosceles. //what should i be inputting? Where could I be going wrong? Thank you x
#include using namespace std; int main() { float a, b, c; cout > a >> b >> c; if (a == b && a == c) { cout
LOL im 16 and im trying to learn to code. Awesome vid CodeBeauty! One more thing, when I put the else it shows as an error and says that it expects a statement. I tried everything and i couldn't get it to execute. Do you think you might know why??
ma'am you said that if we have one command inside an if else statement then we can delete the curly brackets but from line 16 to 21 we don't have only one command so how can we delete the brackets?
When 16 and 21 are deleted the middle else and if are combined into an else if statement which only has one command. This gives a cascading structure opposed to a nested structure with multiple indentation levels. The video would have been a wee bit better if this was explained towards the end but otherwise is a solid explanation. Nested: if(con1){code for con1} else{ if(con2){code for con2} else{code for no con} } Cascading: if(con1){code for con1} else if(con2){code for con2} else{code for no con}
#include using namespace std; // User enter length of triangle (a, b, c) // then lets decide the nature of the triangle whatever its isosceles, equilateral , scalene int main() { int s1, s2, s3; cout s1 >> s2 >> s3; if (s1 == s2 && s1 == s3) { cout
I started testing if and else, and if the user types letters, how to make the program ask for numbers to be typed. I tried to do it, but stuck in that part. I copied the code in the paste bin::: pastebin.com/s0N4KL42 a tip for the next videos is to propose two or three exercises to be corrected at the beginning of the next video or in a separate video.
using namespace std; /* if the user types numbers, the program keeps checking what type of triangle it is. If the user enters a letter, the program will ask for numbers to be entered. */ int main() {
float n1, n2, n3, checker;
cout > n1 >> n2 >> n3; if (n1 && n2 && n3 == checker) //my problem is here. { if (n1 == n2 && n2 == n3) { cout
📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book
Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook
🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/
Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.
This is a very nice video. Just one more thing. We should first check if A+B>C && B+C>A && A+C>B so to have a valid triangle. (For example 2 3 7 is not a triangle). As for the method of teaching, it is excellent!
Great contribution! 🥰
Thank you mate for this insight. Attention to details.🙂
This is great tutorial for all those who are starting to learn C++ or programming in general. Very usefull!
Thanks a lot. :)
You explain this in an easy and understandable manner! Very helpful, thank you. I just started my first semester in CS
After bouncing my head off a bunch of tutorials in the past and ultimately giving up I'm glad I found your channel! the ascii video and you challenging me to decipher it helped so much, but now moving on to these next few videos and having a visual laid out, it's just absolutely clicked with me. I feel like I'm on a roll, I even filled out the nested bit before you even explained how to do it!
You are a fantastic teacher, I can't believe these are free. Most definitely subbed.
studying javascript but gave this a look since I've been struggling with nested if/else and the diagram really helped. Thanks
Pozdrav Saldina, za ovaj tutorijal (kao i za tvoj kanal istovremeno) sam saznala tako sto nam ga je preporucio profesor C++ sa Floride . Bravo devojko! 😊
Drago mi je da me i tamo gledate, nadam se da si našla korisnog materijala na mom kanalu. Veliki pozdrav! 🥰
Thanks so much for all of these videos
Pretty good, although as someone who is bad at math, part of me is pained to be dealing with geometry again.
Very good example to learn if/else statement, thanks. We also can add the case when one of the lengths is equal to 0, then it is not a triangle.
Yes! Excellent idea, checking for 0 or a negative number is a great way to improve this code!
I cant say this is Great, this is not the Great, this is BEST.
I'm so happy that I can help 🤗🥰
You're a life saver
Спасибо , мне как начинающему очень полезно и наглядно. Thank you)
Ok after all this work. I found you have to enter the lengths only separated by spaces.
Seems like someone on here could have given me a heads up or something. Thanks for the troubleshooting experience.
I keep gettting Scalene so I added a check at the end to see what a b c was. Fixed sort of.
This was the output:
a, b, c7,7,7
Scalene Triangle
7
0
4.59163e-41.
So why is this happening? I was able to get it working only by getting the lengths 1 at a time.
This the code I got to work:
#include
using namespace std;
int main()
{
float a,b,c;
//variables
float aside, bside, cside;
//enter side a
cout
If a==b
if b==c
equilateral
else
isosceles
else
if b==c
isosceles
else
scalene
THANKS FOR MAKING THIS VIDEO.
you're welcome ☺️😀
Got me thinking hard on this one.
which one is better? else if or if nested under else ? luv to hear from you.
Thank you for sharing. So do many different programmers deal with “cleaning” as much when typing along each line?
i was following and not to complete to the end of the line and try to do it my self, it was very helpful and literally just after you wrote
if (a == b && b == c)
{
cout
Great video!
I'm writing from Italy and here we're taught that equilateral triangles are a subclass of isosceles triangles. I'm surprised that you follow Euclid's thinking (isosceles triangles have two AND ONLY two sides of equal length): may I ask you if that was a choice to simplify the video or indeed you have that difference in mind?
is very good your tutorial - all the best
We can also use
if ( a == b == c )
This is amazing. Thank you 😊
😘🥰🥰
Thank you for your nice video.
Just curious, how many if/else statements should you use.
Awesome stuff CodeBeauty, loving this stuff.
You can use as many as you need - your program is going to work. But, after some time (three or four if/else-s) it becomes kinda hard to read, and instead of adding more if-s and else-s better solution would be to use "switch/case" (if that is possible of course)
If/else is often better for checking expressions that result as bool values, whereas switch/case is used if you have other data values (numbers, characters, etc.)
In if/else statement, you are going to decide whether to execute if or else block, but in switch/case you decide which case you are going to execute.
In this playlist, you can find an example of how to use switch/case and build a calculator app. That video would give you pretty good idea of how switch/case is used.
@@CodeBeauty Thanks mate,
Not many creators offer such in-depth explanations to questions asked, you are truly unique in this.
Thanks for putting the fun back into learning :)
your lesson is very good and good explain can create more video about C++ create website
Thank you so much for this series, I have just started a degree in software engineering, and have been struggling with my lecturer's teaching style, I was ready to give up. These tutorials have literally saved my faith in my ability as I actually understand you and your explanations. Thank you!!
One thing, I believe I have copied this code exactly as it appears here, yet I keep getting "scalene" no matter what numbers I enter into the program. What do you think I could have missed that is causing this?
Are you separating the numbers with spaces? For example, "2,2,2" will result in "scalene", whereas "2 2 2" will result in "equilateral".
@@vk2ig Oh wow, I feel really silly now! That was it,, thank you so much!
@@Stoogette87 No problems, and please don't feel silly - this is part of learning to code: try some stuff, and if it doesn't work then try something different. :D
@@vk2ig True, true. I'll definitely remember to try different things now aha, thanks again!
Great video! I have a question though, is there a way to connect the else to it's respective if? I'm currently finding myself using multiple nested statements (right now I have 2 if elses inside another one) and it's easy to connect the 1st and 3rd elses but the 2nd one seems to always get an "expected expression" error.
PS I know this probably isn't the best way of doing this, Im just starting out.
what if I declared my variables as of "double"' data type ? Would you mind explaining?
nice
Is it python a advanced version of c++? In python we have elif operations. Does this present at c++ also?
veeerrryyy helpful thank you...
Is it possible to write another if else situation in the second if else situation?
learning so much from you. it is giving me the confidence to experiment with programming. I hope you don't mind but I have changed your example just to see if I can actually get it to work.....what do you think of the result?
#include
using namespace std;
int main()
{
repeatme: // allows program to reset from this point
// user enters lengths of a triangle (a,b,c)
// program should output whether the triangle is equilateral, isoscelese or scalene
float a, b, c;
cout > a;
cout > b;
cout > c;
cout
I think it would work also if we used the (if - else if - else) statement, wouldn't that be easier than a nested if-else statement?
And thank you so much for the video, I believe your channel has saved my university future in Computer Science.
Muchas gracias
Yes, this can be written as:
if(a==b && b==c)
..equilateral
else if (a!=b && a!=c && b!=c)
..scalene
else
..isosceles
I plan to publish tutorials for a long time, so there will be a lot of things to study on this channel. 🤓
@@CodeBeauty Then I will graduate, thank you so much Mrs.Saldina. Much Respect For You. Have a great life.
@@CodeBeauty Good news about your planing to publish tutorial for long time
thanks saldina !
// Can you help me please. when i start the program and enter a b or c all i get is isosceles.
//what should i be inputting? Where could I be going wrong?
Thank you x
#include
using namespace std;
int main()
{
float a, b, c;
cout > a >> b >> c;
if (a == b && a == c)
{
cout
Try not separating the numbers by commas.
please tell me why we didn't write in the second condition like the first one to be (a!==b&&a!==c&&b!==c) .thank you
thanks, mam💕💖
LOL im 16 and im trying to learn to code. Awesome vid CodeBeauty!
One more thing, when I put the else it shows as an error and says that it expects a statement. I tried everything and i couldn't get it to execute. Do you think you might know why??
Hi 🤗 Paste your code here please 😊
I had the same problem so I just deleted the word "else" and every code after it and the did it again so there was no problem
Hey bro, i just started Coding. how's it been for you so far?
How to set a condition for a Pythagoras triangle
Interesting, it works without any brackets for the if/else statements.
if (a == b && b == c)
cout
It works without brackets if you have only one command, but if you have a block of commands then curly brackets are necessary 🙌
@@CodeBeauty Good to know, thanks!
ma'am you said that if we have one command inside an if else statement then we can delete the curly brackets but from line 16 to 21 we don't have only one command so how can we delete the brackets?
When 16 and 21 are deleted the middle else and if are combined into an else if statement which only has one command. This gives a cascading structure opposed to a nested structure with multiple indentation levels. The video would have been a wee bit better if this was explained towards the end but otherwise is a solid explanation.
Nested:
if(con1){code for con1}
else{
if(con2){code for con2}
else{code for no con}
}
Cascading:
if(con1){code for con1}
else if(con2){code for con2}
else{code for no con}
This is an equilateral Triangle
#include
using namespace std;
// User enter length of triangle (a, b, c)
// then lets decide the nature of the triangle whatever its isosceles, equilateral , scalene
int main()
{
int s1, s2, s3;
cout s1 >> s2 >> s3;
if (s1 == s2 && s1 == s3)
{
cout
weel in this case I prefer python, because have if, elif....... and finally else
The idea of expenation is perfect but it doesnt work in real math ;-)
Of I input d then it says equilateral triangle. Who new.
Merry me :3
I started testing if and else, and if the user types letters, how to make the program ask for numbers to be typed.
I tried to do it, but stuck in that part.
I copied the code in the paste bin::: pastebin.com/s0N4KL42
a tip for the next videos is to propose two or three exercises to be corrected at the beginning of the next video or in a separate video.
#include
using namespace std;
/*
if the user types numbers, the program keeps checking what type of triangle it is.
If the user enters a letter, the program will ask for numbers to be entered.
*/
int main()
{
float n1, n2, n3, checker;
cout > n1 >> n2 >> n3;
if (n1 && n2 && n3 == checker) //my problem is here.
{
if (n1 == n2 && n2 == n3)
{
cout
Comment for Algor