I'm probably gonna learn this soon, but can switch statements be used with sets of characters? (as in you define a variable as "char[4] yesorno", and you can respond differently whether the user entered yes or no)
@vman456 if u meant switch vs if : switch can have more checks . if u meant switch vs if +else if : if u remove the "break" it can test and carry out many things in the same cycle while with an if ur limited to one . its also simpler when u only need to check one variables properties , like input checking
Other tutorials online have said that you should have programs return a value of 0 at the end. Is this true, or is it just a holdover that we don't really need to use?
Another great tutorial, the way I learn from you is by using the Windows 7 Snap Feature and watching your video on one half of the screen and having my VM Linux on the other side.
The best way to learn is to type up the code ourselves and write comment notes within the code for quick reference /* */
Hey bucky, i am using Dev-c++ but the DOS window seems to be giving me wrong results. I followed your tutorials exactly as they are, do you know what's the problem? Plus i can't clear the previous program in the DOS simulation.
hi can anyone hel me i do not how to use switch statement in C i have to make a program that calculate sale taxes using switch statements.first it will ask for base price and category. the category is 1=0% 2=2% 3=5% 4=8.5% and it will print the tax amount and the total to be paid and it will exit at category 5. thanks.
do any of you guys know how i can get these programs so i can try them on my compiler i'v tried to look for them on his cite but had no luck, please some one help?
Thanks For the help but i really need your help i have to implement a switch statement while also using a sentinel controlled loop how would i do that .. my teacher isnt very good at explaining and the book is confusing i need to see some kind of example
Thanx Bucky, your tutorials are awesome.... u don't know how much grateful i am to u... u are the first person I'm subscribing in you tube because i think its really worth it.....
Can you do some exercises ? you know like homework ??? i managed to use this 9 lessons to make a program to convert USDolar to Pesos (argetina) but it would be sweet if you give as some practical exercises.
really good tut. for some reason, i dont think most ppl use switch much. I dont, but it is useful. By the way your video is very crisp and clear and your audio is great too. good job.
tnx a lot new boston :D i just passed my programming assignment kinda late but this helps me lot.
jedoxabelino 18 hours ago
have you made a video with switch,and loopings combined?
taetantantan 2 weeks ago
what if I want the program keep asking me to enter number after the break so that I won't need to compile each time to try out a new number?
Alexandros5th 1 month ago
When you enter in a statement can you punctuate and capitalize?
Brishaun104 2 months ago in playlist More videos from thenewboston
I'm probably gonna learn this soon, but can switch statements be used with sets of characters? (as in you define a variable as "char[4] yesorno", and you can respond differently whether the user entered yes or no)
Jumbif 2 months ago in playlist C Programming Tutorials
@Jumbif its called strings and no not directly you will have to use functions in the string.h library
bondservant4Him 2 months ago
thanks a ton!
GOSUPitZ 2 months ago
You have saved my butt in class! My Professor has totally forgotten what it's like to be a beginner!
aplummer9670 4 months ago in playlist C Programming Tutorials 12
This has been flagged as spam show
can you use operators like && or || in a switch statement?
renliw11 5 months ago
Comment removed
renliw11 5 months ago
LOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOLOL
... Can't be bothered
sujmaster2000 5 months ago
The Viewers are decreasing from part 1 until this part. :D
GCCBT17000 6 months ago 2
@GCCBT17000 can u count? :D
Abraham2nd 5 months ago
@Abraham2nd LOL... is that a request? or a challenge? Hahaha...
GCCBT17000 5 months ago
@GCCBT17000 erm... lol?
Abraham2nd 5 months ago
Thank you again this is realy usefull. You are the best!
WinXPproff 6 months ago
How do you enter number ranges? E.g. I want to enter a test case to see if the user enters any number between 90 and 100, inclusive.
mjolewis7 6 months ago
Comment removed
gbrandx42 6 months ago
This has been flagged as spam show
@mjolewis7 you would do this with an if statement, not a switch-case.
code:
int num1;
scanf(%d, &num1);
if(num1>=90&&num1<=100)
{ /*do something*/ }
gbrandx42 6 months ago
After learning C++, this is sooo easy. I just learning C because im working with C and NASM to make programs :D
tlarson91119 7 months ago 4
Thanks, this is very useful.
jodzjcm 7 months ago
Since we are using int main(void) you do not have to return 0; because of the void
kuljotak47 7 months ago
@kuljotak47 that is false because function mains return type is int, not void. if it was void main() it would be different.
bondservant4Him 7 months ago
continue ur works....
jniroshsl 9 months ago
You should always return 0; at the end of your main function.
deamon689 9 months ago
@deamon689 Logically you could also use exit(0);
Spirrwell 9 months ago
@Spirrwell Granted
deamon689 8 months ago
default: is the equiv of an else statement for switches.
nulledsession 11 months ago
wat compiler are u using?
missle3944 11 months ago
@missle3944 Dev-C++
Machado270 9 months ago
@missle3944 better to follow the lessons from the beggining.
dnbStadium 9 months ago
What are the biggest differences between the switch and if functions?
vman456 1 year ago
@vman456 if u meant switch vs if : switch can have more checks . if u meant switch vs if +else if : if u remove the "break" it can test and carry out many things in the same cycle while with an if ur limited to one . its also simpler when u only need to check one variables properties , like input checking
TomaCukor 1 year ago
CS50.net
Jugdesi 1 year ago
Other tutorials online have said that you should have programs return a value of 0 at the end. Is this true, or is it just a holdover that we don't really need to use?
MrMike3292 1 year ago
This has been flagged as spam show
i found out on the Switch Statement you can't use math function
case x >= y
i can only use it on IF Statement on this case(my exampel)
newmen92 1 year ago
Thanks man ,, i have a an exam tomorow and u healped me allot,,, thanks
:)
Harref2007 1 year ago
@Harref2007 me too i also have exam tomorow i wonder if we know each other
i want to ask a questions
why can't you write math function like for exampel
case 100 >= 90: printf("you have got A on the test");
i think the problem is with >=
thx ahed
newmen92 1 year ago
i want 2 ask questions
aghakhannnn 1 year ago
Comment removed
aghakhannnn 1 year ago
what will the program do if i put semi colon aside from colon after the reserved word "case" and the possible number?
TheJedideah 1 year ago
Google Ads sucks!!! They distract me when I am studying X-(
BulletForMyTeachers 1 year ago
@BulletForMyTeachers Firefox + Adblocker Plus. Then you don't see google adds no matter what site you visit.
DevonHartigan 1 year ago
I went on the website and I couldn't find this code...
Were exactly did you the codes?
fractievoorzitter 1 year ago
please come to Mcgill
shdahaal 1 year ago
. . .can this command contains a a whole number with a decimal point??? .i tried but it cannot. .like "2.5,1.7,etc. ,"
rawliet666 1 year ago
@rawliet666
--did u used float instead of int?
10andrew1012 1 year ago
nice! explanation ^_^!>...i wish u are my instructor hahha!.... my instructor sucks!...!!
art9000 1 year ago
This has been flagged as spam show
@art9000 don't say like this man!
u must have said something like...
If ((instructor != "Bucky") && (instructor != "Greg"))
printf("my instructor sucks!...!!");
// It may seem to be nerd but really friend u need to change the value of instructor... oh! I am acting like a compiler!!! OK peace...
BulletForMyTeachers 1 year ago
great way of explaining things. very easy to understand :)
butzloffrost 1 year ago
thanx
yomanish3011 1 year ago
wats the difference between else if and switch? .... btw great tutorials thnx alot
fuckkg 1 year ago
This has been flagged as spam show
Another great tutorial, the way I learn from you is by using the Windows 7 Snap Feature and watching your video on one half of the screen and having my VM Linux on the other side.
The best way to learn is to type up the code ourselves and write comment notes within the code for quick reference /* */
Thanks again Professor Bucky.
yoshifannumba3 1 year ago
Comment removed
yoshifannumba3 1 year ago
so this works like else if
cybermaniac11 1 year ago
Thanks Bucky! Great job as always! You really make this stuff easy to understand!
imaxreelers 1 year ago
another epic episode lol.
phunagewine 1 year ago
Great video.
TheDarkSagan 1 year ago
wouldn't you want to put printf("enter a number"); before scanf so they know what to do?
dudedudeshnitzel 1 year ago
@dudedudeshnitzel He probably doesn't want to take too much of our time :)
But usually, yes, you should add
printf("Enter the number of....");
:)
santa898 1 year ago
Thanks for the video! You are great at teaching this!
ValosTaonas 1 year ago
Hey bucky, i am using Dev-c++ but the DOS window seems to be giving me wrong results. I followed your tutorials exactly as they are, do you know what's the problem? Plus i can't clear the previous program in the DOS simulation.
likheng1986 1 year ago
why do i need a break after executing default??
steave707 1 year ago
I only had a problem at the end the curly bracket "}"
Ipodlego56 1 year ago
hi can anyone hel me i do not how to use switch statement in C i have to make a program that calculate sale taxes using switch statements.first it will ask for base price and category. the category is 1=0% 2=2% 3=5% 4=8.5% and it will print the tax amount and the total to be paid and it will exit at category 5. thanks.
weroep 1 year ago
Thx man. Now u know u had teach a future programmer :D
Xak3p95 1 year ago
do any of you guys know how i can get these programs so i can try them on my compiler i'v tried to look for them on his cite but had no luck, please some one help?
Joking123456789 1 year ago
Thanks For the help but i really need your help i have to implement a switch statement while also using a sentinel controlled loop how would i do that .. my teacher isnt very good at explaining and the book is confusing i need to see some kind of example
richardm36 1 year ago
thanks for teaching. youre alot better than those in VTC. :D
cheezmozocom 1 year ago
Thanx Bucky, your tutorials are awesome.... u don't know how much grateful i am to u... u are the first person I'm subscribing in you tube because i think its really worth it.....
DeepRoyNDC 1 year ago
Love your tut..you are making me think of buying the book lol
WasabisoupProduction 2 years ago
That's cool I've never used switch before. :)
Curiosity...can you use less than, more than, equal to in switch statements?
icekat83 2 years ago
@icekat83 no, you cant.
0121ryanh117 1 year ago
Thank you so much dude...nice job ^_^
lovemylittleangel 2 years ago
i love you, thanks
kennybenny17 2 years ago
dude you're the maaaaaaaaaaan ... lol
Shorty20122012 2 years ago
good job,excelente video !
xxyuri 2 years ago
can't u just use the if statement?
ScrapyDan 2 years ago
Thank you....nw i last minute studying it for tomorrow exam... lazy to refer books, luckily got tutor in youtube~ TQ very much~
LeoneJalbert 2 years ago
Can you do some exercises ? you know like homework ??? i managed to use this 9 lessons to make a program to convert USDolar to Pesos (argetina) but it would be sweet if you give as some practical exercises.
the lessons are awesome thx you very much
pliskinn0089 2 years ago 11
wow for once i can understand. your special bucky noone can teach me shit inless your a saint lol
XxBUDHUNTERxX 2 years ago
keep up the good job =)
danielreispereira 2 years ago
Great Videos! Keep them coming!
ralo23 2 years ago
really good tut. for some reason, i dont think most ppl use switch much. I dont, but it is useful. By the way your video is very crisp and clear and your audio is great too. good job.
TechApplePie 2 years ago
your right.
but why do you comment everyone of his videos....? just curious lol
Sensadire 2 years ago
nice
gary0110 2 years ago
first
nice
SK1LLZDAK1LLZ 2 years ago