Guys if you don't know what khan academy is, check it out, it is awesome! it teaches you practically everything, sadly no C, so ya you SHOULD work with em, ty for the awesome
@Hoihoijooah yes, if will work also, but else if means that if the original if statement is true then dont check else if statment. If He used 2 if statments compiler will check both statments so multiple blocks of code may be executed, hard to explain let me know if you need more help
thx a lot,I love your tutorial.It makes me feel that crossing the Great Firewall in China is quite worthy:D Looking forward to more awesome programming tutorial.
awesome teaching!!!!!! enjoyed learning c from these tutorials,,,,,,,,wanna learn more programming languages from the new boston...keep up the good work
thanks for the tutorial man... this can also help me with my just basic programming cause it is so simular to c++... hm maybe i can make the register system i've tried to make... but i still dont know how XD
ahhmm.. can i ask a question? what if im not using numbers.. what if im using letters.. what will i put? what code is used for letters? is it still int? how about in stating the variable? will i still use "%"?
Thank you so much for doing this, i've always wanted to get into programming but whenever i've tried i've run away screaming after the first 'Hello World'. This, on the other hand, i understand perfectly. Hell, i even have an idea for a program you could make using only syntax learned thus far!
The "else if" conditional only matters if the original "if" conditional turns out to be false. As soon as one conditional is true, the others will not run.
If you have two or more "if" conditionals, multiple ones could be true at the same time and will all run if true. adding the "else if" and "else" conditionals means that only one action may happen at a time.
@charmanderstail How the hell is that not PG? If you want to teach a 7 year old how to program do it by yourself, let those of us who are here to learn something do so in a fashion that doesn't bore us shitless.
Hey how could I do this for text, I mean instead of: if age==30 bla bla make it: if age=="lol" bla bla, because when I just do that it skips the then statement I have....
@imvuextrabts its the same.. it just depends of the functions.. some dont recognize "getchar()" but recognizes the "getch()" and some are the other way...
@imvuextrabts its the same.. it just depends on the functions.. some dont recognize "getchar()" but recognizes the "getch()" and some are the other way...
@penguinswaddle1 if I were you. If your using windows, it would be better if you dual-boot ubuntu and windows. Ubuntu linux has a text editor that can run c and c++ and other programming language in the terminal. In c, just save your program like file_name.c. To compile it in the terminal, just type, "gcc file_name.c -o file_name.run" and after it compiles, type, "./file_name.run". it can run if you use getchar(), getch(), or even even if you dont put any. you can google it. its free.
He gave me all I wanted (related to C)... specially the Dev C++ (I was about to install the RedHat on which we program at school)... Thanks bucky you saved me.... ;)
That last statement "Else" you could've just used else if ( age < 18) { printf("jailbait); } but else is the same thing, but just saying..thats another way if its easier for others. since < is less than, anything under 18 would be true.
@manutube8080 I've wondered about that too and I've come up with the answer, if you're still interested. try both ways in your compiler and you'll see that if you use if if if else the else will only be applying to the last if, but if you use if, else if, else, the else will apply to all the conditions mentioned above. Try to make your own "dating site software" and then compare what you get for the age 64 or something, hopefully you'll get it
@manutube8080 1: IF only works if true. 2:ELSE only works if false! 3: ELSE IF works in case ELSE fails. But you don't have to use that method. You can use the "Conditional operator"( ? : ), example a == b ? a : b. It means if a is equal to b get the value of a otherwise get b.
@WESKERfromEVIL That and for loops. I hate boss battles in newer games. It's so predictable that it is an atrocity to gamers everywhere. No creativity.
@killseb13 Variables can't have a space in them, so the conventional way to say it would be "whoopingCough" with the two words being squished together and the first letter of the second word being capitalized. Which is also done with more than just 2 words.
could u please help me anyone , after i finished it all and everything when i type the age like for example i typed 21 nothing happens i press enter and it keeps scrolling down and then i type like for example 60 and then it says whatever i typed at age 21 which was"call me" whats the issue here?
For everyone who is just used to typing one preprocessor, for this you will need the conio.h because if will not recognize system("pause") or getch() after if and else statements.
if the if conditions were false the compiler will just bypass the if statements ,,,and same for else if statements and eventually execute print("jailbait"); with or without the else statement it seems kinda redundant there dude,,, good job though,,, and what about the pointers and stuff are there gonna be tutorials about them
age>=60, age>=40 and age>=21 will prevent numbers in between those from being considered "jailbait" ie, 22 will give you jailbait, 45 will give you jailbait. according to the current logic.
i think No difference between "Else if" and "multi if" its another way to use "multi if" and u can figure out that if u write a program once by "Else if"and once by "Mult if"
@Hinokari if you have multiple if statements, each branch can potentially be followed. Also, the last "else" would only be associated with the previous if statement.
(Not a complete program:)
if (foo > bar) { puts("foo > bar");
}
if (foo == 55) { puts("foo == 55");
}
Both conditions can be true, but if "else if" were used, only one branch of execution could be followed.
@Hinokari it makes your code much more legible. Especially since too many if statements can drive you crazy. It is just a way of keeping all the options within one function, instead of dividing them up to their own functions. too many if statements = spagetti code (messy). else if statements = (awsomeness ) hope that helps. i believe im right.
Cheers mate, great vid.. better than my lecturer at uni!!
zaranseran 2 days ago
Yeah finally got this one down!
JJStuffEngineering 3 days ago
I love that voice
JJStuffEngineering 3 days ago
So when you enter 50, you end up with jailbait. Great and simple tutorial, props for that, but the program itself could do better.
exterMEANator 1 week ago
it keepS saying my else statement is wrong
Moonrock9222 3 weeks ago
Guys if you don't know what khan academy is, check it out, it is awesome! it teaches you practically everything, sadly no C, so ya you SHOULD work with em, ty for the awesome
zubhanwc3 1 month ago
Comment removed
SuperRealhigh 1 month ago
I didn't understand why he wrote else if instead of just if? Wouldn't only if work too?
Hoihoijooah 1 month ago in playlist C Programming Tutorials
@Hoihoijooah yes, if will work also, but else if means that if the original if statement is true then dont check else if statment. If He used 2 if statments compiler will check both statments so multiple blocks of code may be executed, hard to explain let me know if you need more help
bondservant4Him 1 month ago
@bondservant4Him thank you for your help, so it's just making computer's job easier. ^_^
Hoihoijooah 1 month ago
@Hoihoijooah yes exactly :)
bondservant4Him 1 month ago
I love this guy...anyone can learn this stuff with a teacher who explains it properly like him...BIG THANKS
thesoty85 1 month ago
This has been flagged as spam show
6:11 i wish....lol...
Arko9858 1 month ago
This has been flagged as spam show
mom?
Arko9858 1 month ago
if(age < 10)
{
pedobear.molest();
}
ElementGriefing 2 months ago in playlist C Programming Tutorials 6
@ElementGriefing else if* hehe :)
hollowichigo101285 1 month ago in playlist C Programming Tutorials - The New Boston
printf("Bucky is awesome :D");
MaxOp1234 2 months ago
when i try this i get a bunch of random numbers then it closes
lightningchicken12 2 months ago
@lightningchicken12 message me your code ill tell you whats wrong
bondservant4Him 2 months ago
hey im trying to make a christmas countdown and im getting an error here it is
13 C:\Users\Jordan\Desktop\coding\christmas countdown\christmas countdown.c `December' undeclared (first use in this function)
lightningchicken12 2 months ago
Enter your age:
109
Jailbait!
97epicman 2 months ago in playlist C Programming Tutorials
I'm 13 and an aspiring games programmer, and thanks to your video's i can already program a simple calculator!! thanks dude!! i subbed
97epicman 2 months ago in playlist C Programming Tutorials
7 people skipped the first few tutorials...
HighFlyingBattery 2 months ago
JAILBAIT
BlazunRazun 2 months ago
Enter your age:
61
Jailbait!
ellondu 2 months ago
this guy's a champ
martkory1 2 months ago
where is the source code for this video on your website?
ExaSquare 2 months ago in playlist C Programming Tutorials
Ok, i have a Q I'm trying to learn c++ to code hacks for a game, is there a certain code i need to learn?
ViiBeClanPs3 2 months ago
@Spandex08 I am pretty sure that is correct.
tspideyboy 3 months ago
mate ,,ur presentation was very nice,, !!
faree1993 3 months ago
great sense of humour and the video helps a lot thanks ! =D
Gabriel2899 3 months ago
Comment removed
ThrashCore13R 3 months ago
LULZ at the printf responses.
Thank you for helping many aspiring programmers such as myself.
Jumbif 3 months ago in playlist More videos from thenewboston
Is this correct - if (age<18) - is it possible to put it like that less than 18 so if you type 1,2,3 ... 17 it will printf underage for ex.?
Spandex08 4 months ago
@Spandex08 Yes, it will.
TheVerbalAxiom 2 months ago in playlist C Programming Tutorials
easy cougar? lol this code is simply "COOL"
jawaharharini 4 months ago
how do you make a pause on something whenever i type 21 i see the message in 1 sec and it exit?
volpexc 4 months ago
@volpexc use getch(); at the end of the code and it will stay open until you type something
tdude179 3 months ago in playlist C Programming Tutorials
I think som greater than and less than sign would be good.
FIREFRO626 4 months ago
coding in c is much easier to understand than c++
softpctips 4 months ago
i dont see how a 80 year old is jailbait O_O
13kmakarenko 4 months ago
@13kmakarenko Exactly. Better to use > than ==
I like the video, but the logic is messed up.
robertcameronjones 4 months ago
try 61.. it will say jailbait lol
mastermax7777 4 months ago
getchar does not work on this??
paulceltics 4 months ago in playlist More videos from thenewboston
@paulceltics I thought that too at first, but I made the mistake of how much it needed indented. Check where getch() is in your complier.
ShunichiDomoto 4 months ago
your examples are very rock! lol
eiiwlee 5 months ago in playlist C Programming Tutorials
lol if he's 22 and his mums 40...his mom was knocked up at 17...
I0met0him 5 months ago
This has been flagged as spam show
thx a lot,I love your tutorial.It makes me feel that crossing the Great Firewall in China is quite worthy:D Looking forward to more awesome programming tutorial.
TheTipeFive 5 months ago
Great tutorial, as always. You should look into working with Khan Academy. These videos would be a great addition to that library.
CrittyWitty 5 months ago 19
awesome teaching!!!!!! enjoyed learning c from these tutorials,,,,,,,,wanna learn more programming languages from the new boston...keep up the good work
gauravmetal1 5 months ago
@thenewboston....... I am going to need ur help with a programming project.... please... ASAP..
lanagaye 5 months ago in playlist C Programming Tutorials
thanks for the tutorial man... this can also help me with my just basic programming cause it is so simular to c++... hm maybe i can make the register system i've tried to make... but i still dont know how XD
GYSgamer 5 months ago
wicked,am loving programming all thanks to you mr bucky
nirmalkumarramdeehul 5 months ago
I will ace my programming exam now after your videos. Thanks so much man!
davester83 6 months ago
great tutorial
helped me much
elpedrodevalles 6 months ago
Hey! What is the c compiler that you use?? Its very good. Please suggest any free compiler for windows 7 64 bit
kevinisaac70 6 months ago
Funny examples lol! Hmm...he's only 22. its awesome!
kevinisaac70 6 months ago
LOL Easy cougar HAHAHA.... speaks good english, makes C programming Extremely EASy to understand and HAS a GOOD SENSE OF HUMOR!!
darklorddragonslaye1 6 months ago 26
have a website 2!??!!
sweet
NoamElBaZ 6 months ago
thenewboston= he lives in boston (probably)
go teach in harwood(srry if misspell)
NoamElBaZ 6 months ago
wish you were teaching in the crappy CSD UOC(Computer Science Department University of Crete)
aquaba17 6 months ago
Would it work to write: if (age<40) ?
And is there any way you could set a range of values for age? As in between 60 and 40(40<x<60 in mathematical language)?
rolandocbf 6 months ago
Comment removed
VaginosaurusRex 6 months ago
@rolandocbf if (60>age>40)
{ printf("I WIN!"); }
else
{ printf("i lose :(");
}
-i surprisingly figured this out on my own.. just played around with it for a bit :)
VaginosaurusRex 6 months ago
@VaginosaurusRex
Thanks,and nice job finding that out on your own as well! :D
rolandocbf 6 months ago
Subbed!
ints115 6 months ago
you explain in 7 minutes what my teacher CANT explain in 4 hours... and im dont even speak english :D
Poneivanfa 6 months ago
you going to fast
I cant type that fast
ysw421 6 months ago
type age 100 u will get jailbait ;) lol fail..
mastermax7777 7 months ago
I looked into your java programing tutorials too, do you use the same examples for everything you do?
cookiesRgood26 7 months ago
dude u are awesome
8tkshahul 7 months ago
ahhmm.. can i ask a question? what if im not using numbers.. what if im using letters.. what will i put? what code is used for letters? is it still int? how about in stating the variable? will i still use "%"?
eahr91 7 months ago
@eahr91 if you are using lettters you need to declare it as char x; and use %c
bondservant4Him 7 months ago
Thank you so much for doing this, i've always wanted to get into programming but whenever i've tried i've run away screaming after the first 'Hello World'. This, on the other hand, i understand perfectly. Hell, i even have an idea for a program you could make using only syntax learned thus far!
SepradistPhantom 7 months ago
Comment removed
Cyphlix 7 months ago
Comment removed
Cyphlix 7 months ago
Comment removed
Cyphlix 7 months ago
the funny thing is if u type for example 22 years old it will say: jailbait :D
knStranger 7 months ago
This has been flagged as spam show
check out my videos
EricChris8 7 months ago
Thanks a lot dude. You are the best!
WinXPproff 8 months ago
6:20
The only instructions you shouldn't follow from this tutorial. xD
XxarekushisuxX 8 months ago
if ive been to school try learn this, i would give a shit ;p co< school sucks ;p
SwipperHD 9 months ago
What's the difference between "if" and "else if"? What will change? Nice Tutorials! :D
MisterLaserPointer 9 months ago
@MisterLaserPointer
The "else if" conditional only matters if the original "if" conditional turns out to be false. As soon as one conditional is true, the others will not run.
If you have two or more "if" conditionals, multiple ones could be true at the same time and will all run if true. adding the "else if" and "else" conditionals means that only one action may happen at a time.
williamforcier 9 months ago
m' gonna call you professor Greg
Saltiag0 10 months ago
Heheh, this is why class rooms suck and the Internet rules.
Spirrwell 10 months ago
Keep your examples pg please!
charmanderstail 10 months ago
@charmanderstail How the hell is that not PG? If you want to teach a 7 year old how to program do it by yourself, let those of us who are here to learn something do so in a fashion that doesn't bore us shitless.
iswatchi 10 months ago
@iswatchi relax it was a joke...
charmanderstail 10 months ago
nice teacher as well as a nice man too...
you are the best!!
you have made thousands of lives using ur knowledge n efficiency...
a donation from me is sure, within a near future....
cheeres up!!
vivekkumardaga 11 months ago
Comment removed
vivekkumardaga 11 months ago
should have made it to if they're older than 60 put "go away" or something
itsaidhi 11 months ago
what is the difference between ''if'' and ''else if''? if i replace else if with if in this script what will change?
DJGPR2 11 months ago
Your tutorials are awesome!
Akiren777 11 months ago
I use neatbeans, and I tried to do what he's doing but it seems like my compiler doesn't recognize else if :((
I hate C
dReazG11 1 year ago
Hey how could I do this for text, I mean instead of: if age==30 bla bla make it: if age=="lol" bla bla, because when I just do that it skips the then statement I have....
ScrewedUpDNA21 1 year ago
lol
mmaassiikk 1 year ago
Brilliant tutorials. Thanks alot man!
scac84 1 year ago
great job man !!! thanks alot
Andrei88m 1 year ago
@penguinswaddle1 It's "getch()" not "getchar()"
imvuextrabts 1 year ago
@imvuextrabts its the same.. it just depends of the functions.. some dont recognize "getchar()" but recognizes the "getch()" and some are the other way...
MrKyte12 1 year ago
@imvuextrabts its the same.. it just depends on the functions.. some dont recognize "getchar()" but recognizes the "getch()" and some are the other way...
MrKyte12 1 year ago
how come when i press enter it just says what i wanted it to print but then closes?? I have getchar() too. can anyone help please? thanks in advance
penguinswaddle1 1 year ago
This has been flagged as spam show
@penguinswaddle1 It's "getch();" not "getchar();"
imvuextrabts 1 year ago
@penguinswaddle1 if I were you. If your using windows, it would be better if you dual-boot ubuntu and windows. Ubuntu linux has a text editor that can run c and c++ and other programming language in the terminal. In c, just save your program like file_name.c. To compile it in the terminal, just type, "gcc file_name.c -o file_name.run" and after it compiles, type, "./file_name.run". it can run if you use getchar(), getch(), or even even if you dont put any. you can google it. its free.
MrKyte12 1 year ago
This has been flagged as spam show
@PSKuwaity || means or (shift + the button to the right of the curly brackets), && means and (13 and 33).
ddavv1 1 year ago
@PSKuwaity || means or (shift + the button to the right of the curly brackets), && means and (13 and 33).
ddavv1 1 year ago
i have a question tho...
why couldn't you just do
if (age==60) {}
if (age==23){}
etc?
or are you not allowed to do that when you're using a final "else" statement?
LOLHICRONO 1 year ago
@LOLHICRONO your right it doesnt mather in this case if you would had like this example
if (age == 60){
//result
}
if(age <100){ //age lover then 100
//result
}
if your code would look like this and you enter "60" both result will trigger but if you do a else if on the last condition, it wont..
trashkan66 1 year ago
@trashkan66 alright thanks.
LOLHICRONO 1 year ago
you're awesome man. god bless you for the service you're doing.
azmall11 1 year ago
This has been flagged as spam show
Good tutorial but to learn in-depth I recommend cs50.net. Theses courses are from Harvard university.
Cs50.net
Jugdesi 1 year ago
:P
I never knew what A cougar meant when I made my name...
Mexicouger 1 year ago
If you guys wanna learn programming but think it's boring to learn, buy garry's mod!
Wiremods "Expression 2" will give you a good start. :D
TaceoGamingTutorials 1 year ago
Thank you so much for posting this!
I'm a 15 year old and even though I listen to my teacher, I just don't get the if and else statement, but now I do, thank you! :)
Superclaireful 1 year ago
really superb job teach us c# toooooo
1990sweethoney 1 year ago
oh, god... teh indentation...
VelocityTheory 1 year ago
You are the best teacher! I wish my professor could learn from you.
25Anne1 1 year ago
worlds best teacher
bharathadas 1 year ago
Wow!! he is only 22...
His example seems to be funny... :)
He gave me all I wanted (related to C)... specially the Dev C++ (I was about to install the RedHat on which we program at school)... Thanks bucky you saved me.... ;)
Subscribed :D
BulletForMyTeachers 1 year ago 24
i love bucky
pusangpula 1 year ago
Comment removed
kraeckelium 1 year ago
what's your program that you are executing with ?
please answer me
Scatteril 1 year ago
@Scatteril
The programme he's using is Dev C++. Just google it and you'll surely find a download.
Chasperli558 1 year ago
@Scatteril Dev C++ 4.9.9.2
vidit681 1 year ago
. .thank you so much!!. .
rawliet666 1 year ago
easy cougar LOOOL
KingJulien234 1 year ago
That last statement "Else" you could've just used else if ( age < 18) { printf("jailbait); } but else is the same thing, but just saying..thats another way if its easier for others. since < is less than, anything under 18 would be true.
CuntPussyFuck 1 year ago
why not
IF
IF
IF
ELSE
manutube8080 1 year ago
@manutube8080 I've wondered about that too and I've come up with the answer, if you're still interested. try both ways in your compiler and you'll see that if you use if if if else the else will only be applying to the last if, but if you use if, else if, else, the else will apply to all the conditions mentioned above. Try to make your own "dating site software" and then compare what you get for the age 64 or something, hopefully you'll get it
KingJulien234 1 year ago
@manutube8080 1: IF only works if true. 2:ELSE only works if false! 3: ELSE IF works in case ELSE fails. But you don't have to use that method. You can use the "Conditional operator"( ? : ), example a == b ? a : b. It means if a is equal to b get the value of a otherwise get b.
BlackHeavenSymphony 1 year ago
@manutube8080 with IF... it will check ALL of them... and with ELSE IF... it stops checking when it finds a match.
TheUzi408 1 year ago
hey Bucky great vid man. You are an inspiration :D
butzloffrost 1 year ago
@butzloffrost with IF... it will check ALL of them... and with ELSE IF... it stops checking when it finds a match.
TheUzi408 1 year ago
hey we can use "if " in place of "else if " coz they du the same thing. can we?
hassanziadon 1 year ago
This has been flagged as spam show
@hassanziadon with IF... it will check ALL of them... and with ELSE IF... it stops checking when it finds a match.
TheUzi408 1 year ago
Comment removed
santa898 1 year ago
Great tutorial 5/5 , didnt like the example though (num1 , num2 ) thingy
whymeproducz 1 year ago
best teacher of all time!!! tnx a lot dude
Chuckmetal2 1 year ago 78
Comment removed
Foxythegreat1 1 year ago
I think video games use a lot of if, else if statements.
WESKERfromEVIL 1 year ago
@WESKERfromEVIL That and for loops. I hate boss battles in newer games. It's so predictable that it is an atrocity to gamers everywhere. No creativity.
partyboy9013 1 year ago
Comment removed
trashkan66 1 year ago
really great tutorial.. better than Tim Heagarty of VTC! that sonofabitch don't know how to teach
ownedboxes 1 year ago
Great tutorial series
rebell115 1 year ago
Great except when I push enter my program crashes.
TheDarkSagan 1 year ago
thanks bucky for the videos!
killseb13 1 year ago
haha!! The if whooping statement!
if(whooping cough==10)
{ printf("I'm dying"); }
else if (whooping cough==5)
{ printf("I still can live"); }
else (whooping cough==1)
{ printf("thank God!"); }
killseb13 1 year ago
@killseb13 Variables can't have a space in them, so the conventional way to say it would be "whoopingCough" with the two words being squished together and the first letter of the second word being capitalized. Which is also done with more than just 2 words.
crazynoob11 1 year ago
@crazynoob11 thank you for acknowledging my comment on whoopingCoughs! ^^
killseb13 1 year ago
I used to be a Visual Basic 6 programmer, But C is more fun!
ScienceTutorials 1 year ago
@dadeco3
To make the code more simple and short...
ScienceTutorials 1 year ago
why dont you jus write "if" for all the tests instead of "else if"?
dadeco3 1 year ago
Comment removed
dadeco3 1 year ago
could u please help me anyone , after i finished it all and everything when i type the age like for example i typed 21 nothing happens i press enter and it keeps scrolling down and then i type like for example 60 and then it says whatever i typed at age 21 which was"call me" whats the issue here?
whymeproducz 1 year ago
Are you running a 186 PC! Your compiler seems very slow.
lazarus554 1 year ago
For everyone who is just used to typing one preprocessor, for this you will need the conio.h because if will not recognize system("pause") or getch() after if and else statements.
Good luck :)
wasabisquishy 1 year ago
thank you so much!!!
your tutorials are great! :)
DarkChii77 1 year ago
Why is it, every time I do this it says
"The system cannot find the file specified?"
SnowboardKid8023 1 year ago
how do you do between ages so like between 20 to 30 or like that?
maraisjf 1 year ago
@maraisjf if (( x > 20 ) && (x < 30 ))
mnmboy9147 1 year ago
Spaghett code just make it one statement because all the curly braces can make things confusing and with devc++ the program will not work
VidsOfOurLabor 1 year ago
I enter your code on dev c++ and it gave me a bunch of errors what did I do wrong I been working on it for about 5 hrs
Ipodlego56 1 year ago
if the if conditions were false the compiler will just bypass the if statements ,,,and same for else if statements and eventually execute print("jailbait"); with or without the else statement it seems kinda redundant there dude,,, good job though,,, and what about the pointers and stuff are there gonna be tutorials about them
hesham3540 1 year ago
if i will subscibe is there so more tuturials such as about pointers and what do i actually subscribe to?
by the way very good explenation
your are the best i have seen
wissam1110 1 year ago
age>=60, age>=40 and age>=21 will prevent numbers in between those from being considered "jailbait" ie, 22 will give you jailbait, 45 will give you jailbait. according to the current logic.
ender2070 1 year ago
whats is easycougar and jailbait means??
lena4player5 1 year ago
i wanna ask what is the difference between "Else if " and multi- "if" like the previous tutorial (4),or in the other word,
why we need to use "Else if " instd of "If....If....If....."
Hinokari 1 year ago
i think No difference between "Else if" and "multi if" its another way to use "multi if" and u can figure out that if u write a program once by "Else if"and once by "Mult if"
hamada201016 1 year ago
@Hinokari if you have multiple if statements, each branch can potentially be followed. Also, the last "else" would only be associated with the previous if statement.
(Not a complete program:)
if (foo > bar) { puts("foo > bar");
}
if (foo == 55) { puts("foo == 55");
}
Both conditions can be true, but if "else if" were used, only one branch of execution could be followed.
dyer85 1 year ago
@Hinokari it makes your code much more legible. Especially since too many if statements can drive you crazy. It is just a way of keeping all the options within one function, instead of dividing them up to their own functions. too many if statements = spagetti code (messy). else if statements = (awsomeness ) hope that helps. i believe im right.
boniturs 1 year ago
thanks a lot man this really helps
Drranaba 1 year ago
How come I have "call me" when I entered 15?? lol
chamcham212 2 years ago
how about showing us nested if??? please??
kennybenny17 2 years ago