Conditionals and Loops (Solved Problem 2)

  Рет қаралды 181,272

Neso Academy

Neso Academy

Күн бұрын

Пікірлер: 124
@apporvaarya
@apporvaarya 5 жыл бұрын
This problem statement was mind blowing
@ellenantonyan8977
@ellenantonyan8977 3 жыл бұрын
Honestly, I've been taking C++ classes in my uni, but not only was it not interesting, but also iI didn't learn anything. I love these videos, I learn a lot and it's actually fun, Thank You!
@D_iv_ya
@D_iv_ya 4 жыл бұрын
Really ,fst time I enjoyed programming and felt it is interesting🤩😊😍
@chiragdevnani7283
@chiragdevnani7283 4 жыл бұрын
Still a better suspense movie than Race 3 :p
@shambhunathpandey1262
@shambhunathpandey1262 4 жыл бұрын
😂
@gatecomputerscience1484
@gatecomputerscience1484 3 жыл бұрын
Chutkula...😂😂😂
@mateuszlukaszczyk5359
@mateuszlukaszczyk5359 4 жыл бұрын
i felt for it, didn't know break is not a necessary thing. Always learning something from your videos! Cya
@RhaenyraT2001
@RhaenyraT2001 7 ай бұрын
I love how he slowly explains the stupidity and we are still not able to catch it and try staring at the screen in a weird way. Love it.
@gatjuatwicteatriek4590
@gatjuatwicteatriek4590 Жыл бұрын
I don’t know how much I can appreciate neso academy. This is the channel everyone should use and pass
@follow_anil
@follow_anil 2 жыл бұрын
Actually one mistake sir in code output please update eventually I'm learning lot of knowledge on this channel "Please Update" Thank u sir love u❤❤❤❤❤❤❤
@qandos-nour
@qandos-nour 4 жыл бұрын
I fell in the trap XD thank you Neso
@raitup00
@raitup00 4 жыл бұрын
Yes, me too
@ledgerdavid3435
@ledgerdavid3435 3 жыл бұрын
i dont mean to be offtopic but does any of you know a way to get back into an instagram account?? I somehow lost my password. I appreciate any tricks you can give me
@ledgerdavid3435
@ledgerdavid3435 3 жыл бұрын
@Jose Zeke I really appreciate your reply. I found the site thru google and Im in the hacking process now. Takes a while so I will reply here later when my account password hopefully is recovered.
@ledgerdavid3435
@ledgerdavid3435 3 жыл бұрын
@Jose Zeke it worked and I actually got access to my account again. I am so happy:D Thank you so much you really help me out :D
@josezeke8808
@josezeke8808 3 жыл бұрын
@Ledger David You are welcome xD
@hemanthkumar8963
@hemanthkumar8963 3 жыл бұрын
Sir sir sir u are rocking sir !! Truly I fell in love with ur teaching sir❤️
@itbase2
@itbase2 5 жыл бұрын
such a grate imp of break
@apporvaarya
@apporvaarya 5 жыл бұрын
Wow..your this series is amazing
@ChandanKumar-zl5jo
@ChandanKumar-zl5jo 2 жыл бұрын
You teach for engineering student for whatever you course taught to us like for jee main aspirants of alakh Pandey sir i always like such person.
@vikashmishra1903
@vikashmishra1903 4 жыл бұрын
Congratulations #neso_academy for 1M subscribers ❤️🎉
@ayushiydvKG
@ayushiydvKG 11 ай бұрын
indeed incredible ques and even incredible u as a tutor. lots of love!!! 💌🙏
@parisahasani7880
@parisahasani7880 3 жыл бұрын
I loved the way you teach and this "break" point, actually :D
@tayyab.sheikh
@tayyab.sheikh Жыл бұрын
I guessed the answer right by pausing the video.
@praveenpatel9972
@praveenpatel9972 6 жыл бұрын
All lectures are superb. Please upload at least 5 videos daily on data structures and algorithms. Thank you.
@gatecomputerscience1484
@gatecomputerscience1484 3 жыл бұрын
Choti choti but moti bate, this the way to really teach the people's,sir well known where the students make the mistake
@Varian_t
@Varian_t 5 жыл бұрын
That was the epic twist🤪🤪
@otetumooluwaseun3948
@otetumooluwaseun3948 Жыл бұрын
I got it this time around. I knew from the beginning that there is no break statement, so others get executed. I read that in "Head first with C" in the train exercise.
@meryemonzy8532
@meryemonzy8532 5 жыл бұрын
Woow thank you so much❤️❤️❤️
@anishkhadka925
@anishkhadka925 Жыл бұрын
Awesome video 🥺
@rideaux8533
@rideaux8533 Жыл бұрын
nice problem, really enjoyed it
@salonichaurasia885
@salonichaurasia885 2 жыл бұрын
Amazing,just wow!
@AshishAmbati
@AshishAmbati 2 ай бұрын
this is soo good, thank you
@Codality
@Codality 3 жыл бұрын
But let me tell my dear friends 😅👍 The best digital university in the world, thx again and again and again and again
@naurinsultana1166
@naurinsultana1166 4 жыл бұрын
yay finally could solve a problem correctly !!!
@rakeshkumarsingh6287
@rakeshkumarsingh6287 4 жыл бұрын
U solved it correctly??
@xiaoshan9722
@xiaoshan9722 3 жыл бұрын
correct again!! thanks Neso
@silasabel5432
@silasabel5432 2 жыл бұрын
Great content mahn🙌
@daverussell4052
@daverussell4052 3 жыл бұрын
since neso always trap me with this kind of question... i always try to think harder if the answer its way to obvious lol
@aravindks7636
@aravindks7636 4 жыл бұрын
Yea boyy..I make it correct on first
@sayanpradhan1236
@sayanpradhan1236 3 жыл бұрын
very smart coding
@rakeshraj688
@rakeshraj688 6 жыл бұрын
nice one....
@rushikothari1261
@rushikothari1261 4 жыл бұрын
Very Good Question
@sudarshan740
@sudarshan740 Жыл бұрын
Great😊
@arindamIT
@arindamIT 5 жыл бұрын
osadharon... Guru apni chilen kothay!!!
@prashantbhattarai3747
@prashantbhattarai3747 5 жыл бұрын
after 1st loop then on increment becomes 17...again all case shouldn't be executed? why only default is executed second time rather than there is no any break statement?
@mohamednaser6070
@mohamednaser6070 5 жыл бұрын
because in first loop when i = 0 we check the first case case 0 : is correct so we start this case and all cases after it but when i=17 non of the cases is true to start evaluated next cases so you go to default
@akshitarora470
@akshitarora470 4 жыл бұрын
All cases only after a true cases get evaluated (in the case of no breaks applied! think of a car over speeding the moment a green light is seen.)
@venkythesmart440
@venkythesmart440 4 жыл бұрын
17 'th is not there in switch case. At that moment what can be excuted.
@hasanshaikh2014
@hasanshaikh2014 4 жыл бұрын
because there is no case in which 17 is present as you know that we always compare with a case number that is the second time it goes to default case
@mohitbadal2577
@mohitbadal2577 3 жыл бұрын
Thanks a lot sir ji
@shreyatanku2035
@shreyatanku2035 4 жыл бұрын
Jesus I blindly thought it was first option btw i love these classes
@stevefox2318
@stevefox2318 4 жыл бұрын
Wow just amazing
@rutvikvaghadiya3659
@rutvikvaghadiya3659 3 жыл бұрын
Sir at 4:30 the other case also get evaluate d except 0 as there is no break. Why is not get evaluate d? Pls tell
@AM-qi3xy
@AM-qi3xy 3 жыл бұрын
Why wouldn’t 17 get the same way of evaluation as the 0 in the first step , there is no break in these cases too , so we did mix the cases only once ?
@bhanu8543
@bhanu8543 3 жыл бұрын
Because 0 was Frist case and it was true then there is no break so remaining statements are also evaluated but 17 is flase for all cases they are no gona evaluated only default gets evaluated.
@shubhamjain154
@shubhamjain154 3 жыл бұрын
For the first time I've given right answer of the quiz....😂😂
@shreenathkv3879
@shreenathkv3879 3 жыл бұрын
I paused for almost 3 min the program looked flawless and then realised no break ; 😂😂😂😂
@TheSadhguruSense
@TheSadhguruSense 4 жыл бұрын
variables are not allowed in switch cases
@prodiptamondal1758
@prodiptamondal1758 3 жыл бұрын
variables are not allowed in case label, it is allowed in switch label
@BulbulAhmmed-c9l
@BulbulAhmmed-c9l Жыл бұрын
Sir I have a question. In the 2nd attempt why 17 is not match with case0,case1,case5 and directly go the default?
@chinthalasrujan3765
@chinthalasrujan3765 5 жыл бұрын
sir, but a case statement will get evaluated only when the value equals the case value only no sir then after case 0:,directly case 5: should get evaluated right,please clear my doubt
@vijaychaurasiya3227
@vijaychaurasiya3227 5 жыл бұрын
If any one case is satisfied then all the cases below that case will be evaluated(if breaks are not given)
@vishallondhe7298
@vishallondhe7298 5 жыл бұрын
switch statement does the condition checking with case no but because after case 1 there is no condition checking like switch, all the other statement after it will get evaluated.
@khushalmalu7045
@khushalmalu7045 3 жыл бұрын
Sir I would like to tell no return 0; statement so no output 😮🤓
@The__kulkarni__28
@The__kulkarni__28 4 жыл бұрын
sir,in your previous videos u asked us not to duplicate the cases.Then y did u repeat i+=5 for 2 times??
@karthikbs8749
@karthikbs8749 4 жыл бұрын
You cannot duplicate the case labels. For example case 0: cannot be written two times but the expression i+=5 can be written any number of times. Hope this helps.
@KimTaehyung-ex3ts
@KimTaehyung-ex3ts 3 жыл бұрын
Sir plz upload python course after completing c I want to learn python from you only you plzzzzzz
@dalwindersingh9455
@dalwindersingh9455 4 жыл бұрын
Nice explanation ,want to contact to learn c programming online thanks
@khushikesarwani1941
@khushikesarwani1941 3 жыл бұрын
But, return 0 is not written there in the code for int main() !!!! Doesn't it have any value?
@santhiyakannan1761
@santhiyakannan1761 4 жыл бұрын
Waiting for your python tutorial
@techadil5808
@techadil5808 6 жыл бұрын
Thanks
@vdharman1272
@vdharman1272 6 жыл бұрын
Nice work
@true4189
@true4189 4 жыл бұрын
Thank u
@sanyampandey3895
@sanyampandey3895 3 жыл бұрын
Correct Answer is c) Compilation Error "AS THERE IS NO RETURN 0 in the END of code" ;)
@AkshatJainSF
@AkshatJainSF 6 жыл бұрын
Correct Answer is c)Compiler Error Since main() has int return type but return statment is not there.
@techadil5808
@techadil5808 6 жыл бұрын
Right answer
@hariharans9977
@hariharans9977 6 жыл бұрын
Super bro..return statement is must on int main..
@sasishushma
@sasishushma 6 жыл бұрын
Usually if there is no return statement in international main() compiler won't through error but if return any value in void main() then compiler will through error
@chinthalasrujan3765
@chinthalasrujan3765 5 жыл бұрын
there is no need of any return type if nothing is mentioned it will return some value ,so no error
@seelammadhusagar4176
@seelammadhusagar4176 5 жыл бұрын
By default new compliers returns zero
@phanindrareddy4885
@phanindrareddy4885 6 жыл бұрын
Complete very fastly sirrrr
@warmachine6204
@warmachine6204 8 ай бұрын
Hey there is a little bit error in your code with your code the output will be 22 but if we want output = 16 21 then the printf function need to write just after default not in the next curly braces ..Thanks me later
@dhiravagrawal3446
@dhiravagrawal3446 4 жыл бұрын
It is not necessary to return loop
@duconsao3768
@duconsao3768 3 жыл бұрын
3:59 can anybody explain for me why the output is not 5 11 16 21 but just 16 and 21
@andistheinforitbutso7513
@andistheinforitbutso7513 3 жыл бұрын
Because there is no "break" after cases.
@Amena_Islam_Shrabony
@Amena_Islam_Shrabony Жыл бұрын
i=21 how? Because i
@compangit1524
@compangit1524 2 жыл бұрын
Comments for myself: Without breaks on all switch cases, then everything below a true case gets evaluated.
@shabeerkhan379
@shabeerkhan379 5 жыл бұрын
Sir, initially the value of i=0 but when compare with switch (i)=switch (0) but every nonzero value is false,then that condition is fails,so the switch loop not executed right?? I think the value of i is printed that is 0 on the screen...is it correct sir?
@sravanakumar9326
@sravanakumar9326 5 жыл бұрын
0 will be treated as false only for conditional operators example: if , while.
@m.nikitha4670
@m.nikitha4670 4 жыл бұрын
sir if we write default statement at starting and then remaining cases subsequently will those cases get evaluated when i=17 i.e., { default:i+=4; case 0: i+=5; case 1: i+=2; case 5: i+=5; } printf("%d",i) now i got incremented and it is 17 now ...then after default will the remaining cases get evaluated or just default is evaluated.?
@shikhardhyani
@shikhardhyani 4 жыл бұрын
Try to code you will get answer yourself only.
@m.nikitha4670
@m.nikitha4670 4 жыл бұрын
ok
@sanyampandey3895
@sanyampandey3895 3 жыл бұрын
evaluate hua tha?
@sonubadaik5014
@sonubadaik5014 2 жыл бұрын
Yes, after getting 17 at default condition rest of the cases will get evaluated. So the final value of i will become 29.
@joelaropet
@joelaropet Жыл бұрын
Tried running this code but it's giving me a result of 22. What could I have done wrong ?
@shalinityagi4829
@shalinityagi4829 4 жыл бұрын
My compiler is giving 22 as an answer ,can you please justify the same
@astro.shatha4668
@astro.shatha4668 4 жыл бұрын
I got the same answer , then I realized that I've missed those brackets '{}' after for loop
@IronMan_2.1
@IronMan_2.1 4 жыл бұрын
Holy mother of Jesus Christ, You got me there 😂😂😂😂
@GandrothulaAbhishek777
@GandrothulaAbhishek777 3 жыл бұрын
Jesus Christ is the name of God. That is the highest name that a mortal tongue can speak. Don't use it for jokes. *Respect God* . And one more thing, don't talk like mother of Jesus Christ, He has no mother. He is The Son of God.
@abdulquadir4100
@abdulquadir4100 5 жыл бұрын
There is no return type here
@Shivam6998
@Shivam6998 5 жыл бұрын
Still wrong it will show compile error because return statement not written in program.
@bogdansikach7709
@bogdansikach7709 5 жыл бұрын
No, because the main function is special and at the end of it zero is returned automatically. Read more in the C99 standard.
@agnishgoswami3833
@agnishgoswami3833 2 жыл бұрын
But My output is showing 22 only.??
@nihalpandey5675
@nihalpandey5675 4 жыл бұрын
Who did it at first attempt?
@abhishekthakur2933
@abhishekthakur2933 4 жыл бұрын
I don't know but something is wrong in this code cause output is infinite times 24
@eeeitguy4655
@eeeitguy4655 3 жыл бұрын
why case 0,1,5 not evaluated in second time
@ENGCY-Mir
@ENGCY-Mir 3 жыл бұрын
because the condition does'nt satisfy
@iamDejaray1
@iamDejaray1 3 жыл бұрын
Iwas caught in the trap of 'break'.
@nagarajat1995
@nagarajat1995 6 жыл бұрын
👍
@samdavepollard
@samdavepollard 4 жыл бұрын
Ouch. You got me. :-)
@vrishabshetty1325
@vrishabshetty1325 5 жыл бұрын
U said default will only excute when no case r satisfied then i should be 13
@Krutarth_Vaishnav_
@Krutarth_Vaishnav_ 5 жыл бұрын
You're Right But There Should Be Break Statement After Every Case Conditions.. Then I Would be 13 Else This is Right What We Shown in Video
@sawankumargope5399
@sawankumargope5399 4 жыл бұрын
😁😁😁😁
@umairalvi7382
@umairalvi7382 6 жыл бұрын
Eazy peazy problems...
@davidnguyen7160
@davidnguyen7160 4 жыл бұрын
how you gonna do me like this?
@nandanupadhyay4936
@nandanupadhyay4936 Жыл бұрын
"It's a Trap" guys. I repeat "it's a Trap". 😂😂
@mayankkabra9420
@mayankkabra9420 3 жыл бұрын
My output is coming out as 491419
@mayankkabra9420
@mayankkabra9420 3 жыл бұрын
Anyone up for this?
@Ivan-Sholana
@Ivan-Sholana 3 жыл бұрын
first i'm confuse why 16 21, then I laugh about my confusing
@tayyab.sheikh
@tayyab.sheikh Жыл бұрын
I guessed the answer right by pausing the video.
Conditionals and Loops (Solved Problem 3)
5:07
Neso Academy
Рет қаралды 166 М.
why are switch statements so HECKIN fast?
11:03
Low Level
Рет қаралды 441 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
IL'HAN - Qalqam | Official Music Video
03:17
Ilhan Ihsanov
Рет қаралды 700 М.
Special Programs in C − Pyramid of Stars
11:06
Neso Academy
Рет қаралды 908 М.
Conditionals and Loops (Solved Problem 1)
6:30
Neso Academy
Рет қаралды 310 М.
String In Char Array VS. Pointer To String Literal | C Programming Tutorial
9:58
How to write Recursive Functions
9:03
Neso Academy
Рет қаралды 453 М.
Understanding and implementing a Hash Table (in C)
24:54
Jacob Sorber
Рет қаралды 376 М.
Conditionals and Loops (Solved Problem 4)
5:41
Neso Academy
Рет қаралды 180 М.
for and while Loops
6:49
Neso Academy
Рет қаралды 772 М.
#8: Boolean and Comparison Operators in C Programming
14:42
Programiz
Рет қаралды 144 М.
C Programming Tutorial for Beginners
3:46:13
freeCodeCamp.org
Рет қаралды 17 МЛН
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН