Loop Control Statements − break and continue

  Рет қаралды 340,013

Neso Academy

Neso Academy

Күн бұрын

Пікірлер: 140
@hritikvasuja6250
@hritikvasuja6250 4 жыл бұрын
What a lecture sir. we cannot imagine these kind of lectures in Colleges
@itsgamingtime..7001
@itsgamingtime..7001 4 жыл бұрын
True.
@pradipmalla8059
@pradipmalla8059 5 жыл бұрын
this channel deserves much more subscribes....you guys are doing really great job ..thanks alot !
@brockolious
@brockolious 3 жыл бұрын
The best C Programming guide and explanations I have ever seen for beginners like me. Clear, concise explanations that we can immediately use in our own C programs. To everyone studying for exams, good luck and you'll do awesome!!!
@arnhelcarbajal1942
@arnhelcarbajal1942 2 жыл бұрын
🥃
@ItachiUchiha-mm5ov
@ItachiUchiha-mm5ov 2 жыл бұрын
This seemed much easier for me for continue #include int main(){ int a; for(a=1;a
@SifenAbdi-sl6lz
@SifenAbdi-sl6lz Жыл бұрын
its a great thing you got going on bruh.
@Salamanca-joro
@Salamanca-joro 9 ай бұрын
What does it mean a% 2 ==0
@Sushilulu
@Sushilulu 8 ай бұрын
@@Salamanca-joro it’s division operation..if we get balance of some value number..then it will pass and not getting through the continue, as it’s basically (a%2!=0)…it’s gonna be an odd number
@nitishsah1060
@nitishsah1060 3 жыл бұрын
Sir you are taking the profession of teaching to next level such a well narrated lecture at free of cost! Thanks a lot sir
@rajeevKr07
@rajeevKr07 4 жыл бұрын
Alternate solution using previous knowledge of while loop thank you neso academy 🙏❤ #include int main() { int i; printf("enter an integer"); scanf("%d",&i); while((i!=0)&&(i>0)) { printf("enter an integer"); scanf("%d",&i); } }
@shutdahellup69420
@shutdahellup69420 2 жыл бұрын
The odd numbers never get printed in this code tho?
@Maha_s1999
@Maha_s1999 2 жыл бұрын
Fantastic lecture! Concise and the differences between break and continue super clear!
@noaMurcianOfficial
@noaMurcianOfficial 4 жыл бұрын
I think that the second example is to complicated, i suggest this code: int main() { for (int i = 0; i < 20; i++) { if (i % 2 == 0) { continue; } printf("%d ", i); } }
@solomonadegboyega874
@solomonadegboyega874 2 жыл бұрын
Thank you for the modification
@idk8idk
@idk8idk Жыл бұрын
He was only using this as an example I think
@tayyab.sheikh
@tayyab.sheikh Жыл бұрын
4:55 "It simply means we won't execute the rest of the statements but we would *continue* to execute the loop"
@ergoproxy3032
@ergoproxy3032 2 жыл бұрын
so for 0:38 i quite didn't understand the necessity of using break in this exercise since i can use only while loop without if and break, it will work exactly same like this(please correct me if im wrong): #include int main() { int n; printf("enter a number;)"); scanf("%d", &n); while(n!=0&&n>0) { printf("enter a number "); scanf("%d",&n); } return 0; }
@sidzmhs
@sidzmhs Жыл бұрын
Damnnnn this video cleared all my doubts!!!!! Its so simply explained, I'm impressed !
@ziko9762
@ziko9762 2 жыл бұрын
#include int main() { int a, b; printf("Enter value: "); scanf("%d", &a); for (b = 1; b
@tofiq62
@tofiq62 3 жыл бұрын
This guy tells lessons better than my university teachers!
@sakshisrivastava7033
@sakshisrivastava7033 4 жыл бұрын
I have been always in doubt with this topic.. Thank you so much for this lecture
@yadhuss919
@yadhuss919 4 жыл бұрын
I before watching this video I was confused with this topic but now I understand how easy it was
@aswithasai4015
@aswithasai4015 3 жыл бұрын
Thank you very much from the bottom of my heart you don't know how much these lectures are helping like me beginners .
@Hustler2025
@Hustler2025 3 жыл бұрын
I come after watching codewithharry c language. I got doubt between break and continue but coming here is worth it.
@Codenames560
@Codenames560 4 жыл бұрын
Thanks - I wrote down your definition for 'Continue'.
@prathamgond4314
@prathamgond4314 3 жыл бұрын
I thought that this channel was only for analog electronics.....I was surprised to see this
@kunalsoni7681
@kunalsoni7681 5 жыл бұрын
before i really confused.. but i watch this video i understand too much . thank so lot sir😙❤😍😊
@ujjwalyadav8253
@ujjwalyadav8253 3 жыл бұрын
I like the whole content of this channel
@shubhammoudgil4408
@shubhammoudgil4408 3 жыл бұрын
one word MIND BLOWING I can't even imagine that these courses are free of cost.
@taifX18
@taifX18 8 ай бұрын
I understand the difference from you in 5 minutes!! thank you so much
@r.ksharma2321
@r.ksharma2321 3 жыл бұрын
Thank you 🖤🖤🖤 so much for clearing all of my doubt easily
@moeentrimzi.8532
@moeentrimzi.8532 3 жыл бұрын
#include int main() { int n=2; for(int i=1;i
@Make_it-Simple
@Make_it-Simple 8 ай бұрын
Simple & Basic 👌
@luongManh361
@luongManh361 3 жыл бұрын
This is really helpful, I get it clearly now
@abdomenebadellah
@abdomenebadellah 3 жыл бұрын
The Helpful Acronym..thanks,sir ❤️
@joehayden6065
@joehayden6065 2 жыл бұрын
Very clear, pedagogically rich!
@ritikshrivastava9442
@ritikshrivastava9442 4 жыл бұрын
Same program without continue int main() { printf("printing the odd number from 0 to 20 "); int i=0; while(i
@purubhargava8096
@purubhargava8096 4 жыл бұрын
u could have used simply i+=2 with i intiation as i = 1 use a for or while loop if occupy more space and reduce the execution time.
@anilakokapeta9203
@anilakokapeta9203 4 жыл бұрын
I am getting successful output by writing this code for the first program:- #include void main() { int a; do{ printf("Enter any number: "); scanf("%d",&a); }while(!(a
@gatecomputerscience1484
@gatecomputerscience1484 3 жыл бұрын
Great explanation
@mdzaki1844
@mdzaki1844 3 жыл бұрын
Excellent explaintion🙌🙌
@rohanjr1234
@rohanjr1234 4 жыл бұрын
Very nice explanation 👌
@danieliniguezv
@danieliniguezv 3 жыл бұрын
amazing explanation! thank you so much!
@zunaedaman1930
@zunaedaman1930 2 жыл бұрын
What a lecture! My current favourite
@prakharkatwal7866
@prakharkatwal7866 Жыл бұрын
#include int main() { printf("Odd numbers from 1 to 20 using i += 2: "); for (int i = 1; i
@arunabhachatterjee9979
@arunabhachatterjee9979 3 жыл бұрын
we can also use this code in continue statement same output :- #include int main() { int i; for (i=1; i
@islammostafa3037
@islammostafa3037 4 жыл бұрын
thank you, the best channel to simplify programming..
@joshua_dlima
@joshua_dlima 4 жыл бұрын
Damn good explanation! Thanks sir
@neniscarlet3880
@neniscarlet3880 6 жыл бұрын
Thank you, very simple and helpful. Keep up the good work!
@nazmapervin7198
@nazmapervin7198 4 жыл бұрын
Ah..now i understand it... thank u so much!!
@rockstarmani
@rockstarmani 4 жыл бұрын
We can also use and (&&) operator in while loop instead using if condition again right!
@ictupdates
@ictupdates 2 жыл бұрын
Very confusing topic made simple b neso fantastic😃😃
@rakshitverma3528
@rakshitverma3528 6 жыл бұрын
you really are amazing with your job keep it up :)
@zishan53
@zishan53 4 жыл бұрын
Osm lecture It is good than other platforms Wonderful
@yehtikephyo94
@yehtikephyo94 4 жыл бұрын
You saved my life. Thanks for your lessons.
@elcactus1159
@elcactus1159 2 жыл бұрын
thanks alot I really got help from this vidz
@charanm1773
@charanm1773 3 жыл бұрын
You are the Best
@Aabara_ka_dabara
@Aabara_ka_dabara Жыл бұрын
neso academy can you make a video on int main and void main diffrence and why return 0
@GeeksPort
@GeeksPort 6 жыл бұрын
Thank you... It was awesome...
@andistheinforitbutso7513
@andistheinforitbutso7513 3 жыл бұрын
Good evening 🙏
@I_veeresh
@I_veeresh 2 жыл бұрын
what i I never understand in my life ,i understand here in this particular lrecture.
@avinashkumarsingh2007
@avinashkumarsingh2007 6 жыл бұрын
sir please keep uploading videos on C and data structures on a regular basis....
@ayushiydvKG
@ayushiydvKG 11 ай бұрын
thankyouuu 💌
@janvi.sharma06
@janvi.sharma06 4 жыл бұрын
Very helpful 🙏👍
@swapnilbhojwani5587
@swapnilbhojwani5587 5 жыл бұрын
#include int main() { int i; for(i=0;i
@sukritisood9443
@sukritisood9443 5 жыл бұрын
We can also print same by using i=i+2 in expression step of for loop
@WILLGYS
@WILLGYS 3 жыл бұрын
Thanks man, that helped
@amalfatyma3365
@amalfatyma3365 4 жыл бұрын
very easy method ....thankyou
@gurmxet
@gurmxet 6 жыл бұрын
thanks man!! appreciated...
@memehhme
@memehhme 3 жыл бұрын
Great....👏🏻
@sateelbasou9582
@sateelbasou9582 2 жыл бұрын
1:00. Why haven't you written Else after writing If inside the while loop? Isn't it is mandatory to write 'Else' if there is a 'If' ?
@alejofossati
@alejofossati 2 жыл бұрын
Good tutorial over all but the example programs given are not the ones I would use... The one used for "continue" for example is convoluted. It's possible to do the same with a much simpler and intuitive method like checking if the reminder is 0 or not. IMO it would be way easier to understand if the example is a problem that actually requires the use of continue. I haven't thought of a case in which it's actually better to use continue but I'm sure there are some...
@Mohamed_sanoob
@Mohamed_sanoob 6 жыл бұрын
thanku for this video neso acadamy
@mohammedanwarsha4273
@mohammedanwarsha4273 4 жыл бұрын
Nirthi poda
@Vish_0910
@Vish_0910 Жыл бұрын
I love your voice😍
@azurehecate4882
@azurehecate4882 2 жыл бұрын
thank you sooo much
@rajivattri20
@rajivattri20 6 жыл бұрын
u r d best
@penguingamingDS428
@penguingamingDS428 5 жыл бұрын
due i liked it , i understood very easily , thx
@rao9076
@rao9076 2 жыл бұрын
Sir 9
@kavithapriyacj4868
@kavithapriyacj4868 4 жыл бұрын
Hatsoff 🙏👍
@shubhamshiketd4256
@shubhamshiketd4256 6 жыл бұрын
Love you sir
@rohitnakkina2393
@rohitnakkina2393 4 жыл бұрын
simply fantastic!!
@KaifKhan-pr5rk
@KaifKhan-pr5rk 3 жыл бұрын
no need of that other equation just modulus the number if the value is 1 then odd otherwise even , continue statement can also be used for reversing the expression of the same written
@siddhantsingh4323
@siddhantsingh4323 4 жыл бұрын
Thanks a lot sir
@yoursnoorie
@yoursnoorie 2 жыл бұрын
I HAVE A DOUBT IN THIS PROGRAM N=N+2....SO WHY IT IS NOT IMPLIMENTING WHEN THE VALUE OF N=2 THE IT SHOULD BE 4 ...AND AFTER INCREMENTING IT SHOULD BE 5 SO WHERE THE THREE GOES
@harpreethundal9814
@harpreethundal9814 2 жыл бұрын
in my practical exam i saw a question which starts from WAP at that time i thought 🤔 it is out of syllabus and i did not tell to any
@nahlaabouchakra7074
@nahlaabouchakra7074 4 жыл бұрын
why did you put n=n+2;
@jjo_02
@jjo_02 3 жыл бұрын
Ella kazhyangalum Naveenu correct aayit paranju kodukanam ketto anna..... Naveene nee padikk👍😬
@NaveenKumar-kp9nn
@NaveenKumar-kp9nn 3 жыл бұрын
✌️
@CemDolcan
@CemDolcan 3 ай бұрын
When i tried to change n value for seeing different opportunities I have noticed that something goes wrong. If I give n for 3,4 results are broke
@frsnzri7975
@frsnzri7975 Жыл бұрын
so Break and Continue is going to be executed when the condition above them is True only right?
@dsa3702
@dsa3702 4 жыл бұрын
Realizing in 2020, WAP.. is something else now 🤣🤣
@elcactus1159
@elcactus1159 2 жыл бұрын
🤣🤣🤣exactly bro
@k-san5355
@k-san5355 2 жыл бұрын
Now from the top-
@kavithapriyacj4868
@kavithapriyacj4868 4 жыл бұрын
Please add complete.computer networks lectures please sir
@true4189
@true4189 4 жыл бұрын
Thank u
@khaleelshaikmohammad4759
@khaleelshaikmohammad4759 3 жыл бұрын
Sir I have a small doubt. Why to write if statement inside the while Loop. Instead we can directly write while(n>0). Can you plz reply me 🙏🙏.
@gurucharankakaraparty4817
@gurucharankakaraparty4817 5 жыл бұрын
I have a doubt In while couldn't we write while(n>0) Wouldn't it be the same
@vishallondhe7298
@vishallondhe7298 5 жыл бұрын
yup, but i guess he wanted to demonstrate the break statement in loop.
@kranthikumar6615
@kranthikumar6615 4 жыл бұрын
Sir I have a doubt?? If unexpectedly user hit a "character" as a input,then what happened..... What's the output then?????? And explain why that is happening there!!
@JKSmith-qs2ii
@JKSmith-qs2ii 4 жыл бұрын
if you break in a loop that is already in a loop, does it just continue the outer loop? Aka if break is in loop 1 which is in loop 2, does a break cause loop 2 to function again without finishing loop 1?
@yujii8820
@yujii8820 3 жыл бұрын
It continues the outer one.
@hetaeramancer
@hetaeramancer 3 жыл бұрын
@@yujii8820 r u sure -_-
@kritisrivastava6451
@kritisrivastava6451 4 жыл бұрын
In first program can we use this condition- If(n!=0||n>0) { printf ("Enter a no."); scanf("%d",&n); } else break; }
@srikakulam9081
@srikakulam9081 4 жыл бұрын
Yes you are right but using if else statement as you said we can take input value one time only.. We use if inside while we can enter positive number number of times. This example is given in this video..
@patchavavengalraovengalrao3784
@patchavavengalraovengalrao3784 4 жыл бұрын
for even numbers if we remove continue statement in second case...then what is the use of " if " statement????
@karimabdul5071
@karimabdul5071 2 ай бұрын
2024❤, still feels afresh
@anuragmukherjee705
@anuragmukherjee705 2 жыл бұрын
legendary
@rudrapratapsingh1048
@rudrapratapsingh1048 4 жыл бұрын
i have a doubt that when 4 will come than how i==n statement is true(because in upper statement we declared n=2) so it will be 4==2 which is not true plz explain someone
@shivamjha1049
@shivamjha1049 2 жыл бұрын
Same doubt
@Hiyori___
@Hiyori___ 4 жыл бұрын
To print the odd numbers I created a program using the modulus operator. It gave me the same result but took 0.359 seconds while your program took only 0.141 seconds.
@s.karunanidhis.karunanidhi4146
@s.karunanidhis.karunanidhi4146 6 жыл бұрын
Tq
@thanuja.07
@thanuja.07 2 жыл бұрын
Why am I getting output as 2345....1920🥺
@ertugrullovers9167
@ertugrullovers9167 3 жыл бұрын
Kya maza ha yr Kaash ki asa clg ma bhi pdhahtay
@patrickdaly7876
@patrickdaly7876 3 жыл бұрын
is this used alot, i have a feeling this is a bit of a lousy programming style, couldnt both of these commands be executed just by changing the syntax of the loops a bit?
@dhruvpaglet2695
@dhruvpaglet2695 Жыл бұрын
Hi
@Elle___K
@Elle___K 4 жыл бұрын
Hello, thank you for these useful videos! In the first example (around 2mins) I am confused on two things: 1 - why is there the need for printf(...) and scanf(.....) at the start of main if that is what you are doing in the while loop? Is it not enough to have it in the while loop? 2 - For the printf and scanf in the while loop, why are there not curly brackets around this part of the code as there is more than one statement here as it is basically the else part right? I hope this makes sense. I am very new to programming and trying to slowly understand more and more but it is very confusing for me. Any help much appreciated! :)
@qandos-nour
@qandos-nour 4 жыл бұрын
Hello A1) bro, variable n is like i in for loop, it is the counter that decide when the loop end we need to initilaize a value for that variable before the loop, and we need to update its value at the end of loop . A2) the curly brakets is a scope, not for more than one statement, in else we put brakets because it is a keyword like for and switch
@goodlife1302
@goodlife1302 3 жыл бұрын
@ Laura K you understood now right ?
@roroC777
@roroC777 3 жыл бұрын
@@qandos-nour ty for trying to explain it. even if you failed
@SifenAbdi-sl6lz
@SifenAbdi-sl6lz Жыл бұрын
am stuck on the fact WAP means "WRITE A PROGRAM"
@taifX18
@taifX18 8 ай бұрын
If you didn’t say that, I wouldn’t know LOL😢
Conditionals and Loops (Solved Problem 1)
6:30
Neso Academy
Рет қаралды 310 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Understanding and implementing a Hash Table (in C)
24:54
Jacob Sorber
Рет қаралды 376 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 248 М.
Conditionals (Switch)
7:24
Neso Academy
Рет қаралды 408 М.
do-while Loop
5:03
Neso Academy
Рет қаралды 703 М.
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,3 МЛН
#14 : break and continue in C | C Programming for Beginners
10:09
Call By Value & Call By Reference in C
8:34
Neso Academy
Рет қаралды 1,4 МЛН
Special Programs in C − Pyramid of Stars
11:06
Neso Academy
Рет қаралды 907 М.