Conditionals and Loops (Solved Problem 1)

  Рет қаралды 310,037

Neso Academy

Neso Academy

Күн бұрын

Пікірлер: 133
@qandos-nour
@qandos-nour 4 жыл бұрын
one year ago I solved a program using for loop without a condition in it, and miss the colon I spent one day looking after the error position and finally I cheated from a friend and surprised from the error ! thank you Neso to make the reason clear
@madhaviyalagam2158
@madhaviyalagam2158 6 жыл бұрын
Till now I never saw like this clear explanation.well plz upload more videos.that will helpful for people who are not able to go institutions&coaching centres like me☺️☺️☺️
@KarthiKeyan-lp7es
@KarthiKeyan-lp7es 5 жыл бұрын
Best teaching in c
@VRR6T
@VRR6T 6 жыл бұрын
Awesome video! It's incredible the way you explain those concepts that aren't commonly shown. Great job! 👏🏼👏🏼👏🏼
@jishanshaikh8961
@jishanshaikh8961 6 жыл бұрын
We all appreciating your work!!! Have a Happy year!!!! I learned a lot from other lectures like signals and systems, Analogue Electronic!!!~~~
@noraimansaupi2569
@noraimansaupi2569 4 жыл бұрын
Can i ask you about coding basic C loop
@noraimansaupi2569
@noraimansaupi2569 4 жыл бұрын
jishan shaikh you can wassp me 0136184581
@mhmdfathi6780
@mhmdfathi6780 5 жыл бұрын
#include #include int main() { int x=1024; int count=0; for(;x;x>>=1) { printf("Hello "); count++; } printf("%d ",count); return 0; } Ans: 11 times
@charanmc4484
@charanmc4484 3 жыл бұрын
Always my favourite channel for learning coding with perfect logics❤️❤️
@MorrowSind
@MorrowSind 6 жыл бұрын
My new favorite channel. :)
@dayana3232
@dayana3232 Жыл бұрын
When he mentioned “we have learned this previously” and I haven’t get to that video lecture yet 😭👍🏼
@stefogo1
@stefogo1 Ай бұрын
I am absolutely soooooo thankful that i found you. Your video are soooo good. You explain very very good. Thank you for that.
@muhammadyaqoob9129
@muhammadyaqoob9129 3 жыл бұрын
SIR, I only saw one of your videos and became your fan. LOVE YOU SIR FROM PAKISTAN....
@Aabara_ka_dabara
@Aabara_ka_dabara Жыл бұрын
still learning new concepts of loops thankyou for your content
@xiaoshan9722
@xiaoshan9722 3 жыл бұрын
unbelievable! when pausing the video and check the program fragment, i got the correct answer.
@Pritamdas-bg7fp
@Pritamdas-bg7fp 6 жыл бұрын
awesome explanation
@kaluvanhariharan4256
@kaluvanhariharan4256 6 жыл бұрын
Very interesting .... excellent explanation ...
@Satyam_10
@Satyam_10 5 жыл бұрын
Your lectures are very helpful you explain in a very simple way
@chanduji8320
@chanduji8320 3 жыл бұрын
Extraordinary skill of explanation
@girirajtomar519
@girirajtomar519 6 жыл бұрын
Best video of c programing
@karancontractor586
@karancontractor586 4 жыл бұрын
Appreciate the questions and thanks a lotttt just a request to increase the volume or keep the mic closer
@AbdElrahmanAmirMohamed
@AbdElrahmanAmirMohamed 4 жыл бұрын
( i >>= 1 ) ...... you can write ( i /= 2 ) instead of Previous expression.
@priyanshugupta4422
@priyanshugupta4422 4 жыл бұрын
Great video...thank u so much. Dil se♥️
@laatjacob8927
@laatjacob8927 5 жыл бұрын
Thanks a lot my brother
@roshnis261
@roshnis261 6 жыл бұрын
Thankyu sir. Kindly add more codes
@sukiya9731
@sukiya9731 2 жыл бұрын
Super question ***THANK YOU****
@harshvardhansharma5850
@harshvardhansharma5850 5 ай бұрын
Answer to the problem is 11, Explanation -> The value i.e. 1024 will be right shifted and will repeat this until the value becomes 1. Right shifted values will be 1024, 512, 256, 128, 64, 32, 16, 8, 4, 2, 1
@arpitac9481
@arpitac9481 3 жыл бұрын
Awesome 👍...
@sachingeorge6090
@sachingeorge6090 2 жыл бұрын
Exallant video sir thanku a lot
@مريمعادل-ب2ك
@مريمعادل-ب2ك Жыл бұрын
عاش سوال تحفة بجد 🇾🇪
@yagneshacharya2461
@yagneshacharya2461 2 жыл бұрын
POV : You can never predict the answer of neso questions
@jeevapriya4853
@jeevapriya4853 5 жыл бұрын
Ur teaching was gd can u pls post more videos on ,design nd analysis of algorithm python nd microprocessor 8086
@sampathrao4149
@sampathrao4149 6 жыл бұрын
A good challenging program
@himanshusoni2818
@himanshusoni2818 2 жыл бұрын
nice explaination
@tomidebbie2078
@tomidebbie2078 2 жыл бұрын
Nice example
@YJsTech
@YJsTech 5 жыл бұрын
omg it was awsome
@yogesh1880
@yogesh1880 6 жыл бұрын
thank you sir
@vidyabukitgar
@vidyabukitgar 5 жыл бұрын
sir actually i couldn't understand how u represented 1024 in binary.can u pls tell?
@proxxy3933
@proxxy3933 5 жыл бұрын
He divided it by 2 and goes on till he get 1
@proxxy3933
@proxxy3933 5 жыл бұрын
Actually 001 etc r d remainders which he get by dividing it by 2 buddy!
@sanpreetbagga8443
@sanpreetbagga8443 5 жыл бұрын
Same here dude
@sanpreetbagga8443
@sanpreetbagga8443 5 жыл бұрын
@@proxxy3933 tqsm prayagni dii😊
@ritikshrivastava9442
@ritikshrivastava9442 4 жыл бұрын
@@nivasreddy u can also simple learn a formula for right shifting (Value of whose shifting is need to done÷2^right operand)
@mhmdfathi6780
@mhmdfathi6780 5 жыл бұрын
He will represent right shifting till he reaches zero and stops
@manjulas4741
@manjulas4741 6 жыл бұрын
thank you so much 🙏
@psociety371
@psociety371 5 жыл бұрын
Superb video
@haniazehranaqvi5366
@haniazehranaqvi5366 2 жыл бұрын
fantastic
@bharathbolloju8225
@bharathbolloju8225 2 жыл бұрын
Bro...small doubt, int datatype can store two bytes of memory...which 8 characters..ur using 10?? Let me know ..that I missing.
@handle_gc
@handle_gc 2 жыл бұрын
No. Size of int depends on compiler. You better understand how right shift(>>) works. Here 1024 represents 2^10 which is 11th place starting from 2^0. ALSO 2 bytes = 16 bits 4 bytes = 32 bits
@jaspreethayer2275
@jaspreethayer2275 6 жыл бұрын
Stunning
@Ak-lt8zy
@Ak-lt8zy 6 жыл бұрын
Thanks
@true4189
@true4189 4 жыл бұрын
Thank u
@kesavamasanam8743
@kesavamasanam8743 5 жыл бұрын
Tq
@inferiorsouls7340
@inferiorsouls7340 2 жыл бұрын
syntax of the for loop stands wrong, as the curly braces are missing
@handle_gc
@handle_gc 2 жыл бұрын
No. If only one statement is written after for(; ; ; ) or while() then it is considered as part of that loop.
@anushareddy5203
@anushareddy5203 5 жыл бұрын
Please providing java concepts also
@gatecomputerscience1484
@gatecomputerscience1484 3 жыл бұрын
Please upload ppt
@strongboi5966
@strongboi5966 6 жыл бұрын
Great! I thought it would be infinate
@samarthtandon2163
@samarthtandon2163 6 жыл бұрын
If the expression was like: i >>=j than the i will be divided by the 2^j And if the expression was like: i
@venkateshviswanath6593
@venkateshviswanath6593 6 жыл бұрын
Samarth Tech i dint get this...y cant it go to again same position from 00000000001 to 10000000000
@Hsjjklm
@Hsjjklm 6 жыл бұрын
@@venkateshviswanath6593 because, in binary if it shifts upto last bit of right or left,after last bit if u give again shift operater either left or right it will go out of the number and sit in carry.if u give again shift carry bit gon and last shifted bit will enter the carry
@Hsjjklm
@Hsjjklm 5 жыл бұрын
@@soorajyadav1585 how is It?
@Hsjjklm
@Hsjjklm 5 жыл бұрын
@@soorajyadav1585 1024 binary number left most bit is 1 rest all zero .If u shift it left 1 will go and sit in carry bit. Number remains is only zeroes.so loop will execute only one time
@ooss748
@ooss748 Жыл бұрын
Should be another easy solution
@ayeshashafat
@ayeshashafat 4 жыл бұрын
If want to know output without paper & compiler then how to do in the case of above question?
@rajivattri20
@rajivattri20 6 жыл бұрын
sir make videos on data structure
@cutiecutie2949
@cutiecutie2949 6 жыл бұрын
why if i>>1is written then executing compiling infinite loop?
@devikollu8977
@devikollu8977 5 жыл бұрын
same doubt
@linodaveiga5642
@linodaveiga5642 5 жыл бұрын
You are missing the = after >> You must write >>= and not >> because they have different meanings
@haribabu1387
@haribabu1387 4 жыл бұрын
Option d
@georgezhelyazkov815
@georgezhelyazkov815 3 жыл бұрын
Where are the Curly brackets after for ?
@georgezhelyazkov815
@georgezhelyazkov815 3 жыл бұрын
Thanks
@wiswor5072
@wiswor5072 5 жыл бұрын
Why is 1024 = 100 0000 0000?
@UCSHareeshKumar
@UCSHareeshKumar 5 жыл бұрын
Change decimal number into binary
@rastaarmando7058
@rastaarmando7058 5 жыл бұрын
because It's 2^10 wich is 10^11 in binary.
@ruturraj
@ruturraj 4 жыл бұрын
how to get binary value
@nikitapendu7637
@nikitapendu7637 3 жыл бұрын
Thorough factorization by last digits in 0,1
@benguvlogs8506
@benguvlogs8506 3 жыл бұрын
Nice
@cylelance4307
@cylelance4307 2 жыл бұрын
Might be a dumb question, but is this just how to code a truth table?
@akshaydeshmukh5158
@akshaydeshmukh5158 6 жыл бұрын
sir then what will be output for left shift instead of right shift in same program
@samarthtandon2163
@samarthtandon2163 6 жыл бұрын
It will go to infinite.... As it multiplies the i by 2 and i never reach to 0
@digvijayparit394
@digvijayparit394 6 жыл бұрын
@@samarthtandon2163 Mine is showing 6 times when i left shifted . Can you explain why??
@jackofnotrades15
@jackofnotrades15 6 жыл бұрын
@@digvijayparit394 which compiler are u using... if integer is 2 bytes in the compiler then answer is correct as after left shifting 6 more times i's value will go to zero...try printing the value of i after the loop it will show u zero.This happens because of round of mechanism....and the default modifier assumed by the compiler i.e signed or unsigned. Did u use int or unsigned int while declaring i as integer?
@sravyasri5101
@sravyasri5101 5 жыл бұрын
Pls say understandingly
@kishors8200
@kishors8200 4 жыл бұрын
@@samarthtandon2163 I will reach 22 times
@compangit1524
@compangit1524 2 жыл бұрын
Comments for myself: It is not necessary to mention all the 3 steps inside the for loop. Here initialization is not done inside it.
@camerald8257
@camerald8257 3 жыл бұрын
I know that if it isn't 0 it means true but how about negative integer? Is it still true?
@its_SR07
@its_SR07 2 жыл бұрын
yes
@guntasgill1896
@guntasgill1896 3 жыл бұрын
i think in question 1, it will be an error because of missing curly braces after for loop.
@andistheinforitbutso7513
@andistheinforitbutso7513 3 жыл бұрын
No error. bcoz the next single line after a conditional loop or a condition does not require curly braces. You may put braces or not. But for two or more lines, curly braces are needed.
@bibinthomas592
@bibinthomas592 3 жыл бұрын
When I write this code as below Hello World is printed infinitely.WHY? int main() { int i=1024; for(;;i>>=1) printf("Hello,World"); return 0; }
@faithmairura5863
@faithmairura5863 2 жыл бұрын
You put two semicolons....
@faithmairura5863
@faithmairura5863 2 жыл бұрын
You didn't give a condition
@faithmairura5863
@faithmairura5863 2 жыл бұрын
Here.... For (; i; i >> 1)
@Ineedabr
@Ineedabr 10 ай бұрын
1:00 11
@akashpurbia4390
@akashpurbia4390 5 жыл бұрын
when we use leftshift operator instead of rightshift operator then hello world will be printed only once.
@rastaarmando7058
@rastaarmando7058 5 жыл бұрын
You really think 1024 is the last number in binary?
@kishors8200
@kishors8200 4 жыл бұрын
@Prashant kumar singh Bro please explain how bro
@38.coanshududhpachare93
@38.coanshududhpachare93 2 жыл бұрын
Compile time error
@scar_mystic
@scar_mystic 3 жыл бұрын
Why 1 followed by 10 zeros at the beginning
@haribabu1387
@haribabu1387 4 жыл бұрын
It doesn't print
@krishnakumargupta6141
@krishnakumargupta6141 5 жыл бұрын
Sir App Hindi mai question bna degai
@accessdenied9393
@accessdenied9393 3 жыл бұрын
I guess that, the shift operator by one used to half and half the value until it reach to zero
@Burn_Andbuild
@Burn_Andbuild Жыл бұрын
I tried this problem in vscode and it doesn’t print 11 times it was infinite times
@mathematics_rajkumar
@mathematics_rajkumar 3 жыл бұрын
Sir.. In code blocks I'm not getting 11 hello world?
@amirjahacongress7010
@amirjahacongress7010 2 жыл бұрын
Why i is equal to 0 in question . I value is equal to 1024 why he is trying to.make i equal to zero
@hahahah1310
@hahahah1310 4 жыл бұрын
how you know binary number of 1024
@Vikram_321
@Vikram_321 4 жыл бұрын
Sir Infinite time ho raha h mera to
@shaikhzeenat4399
@shaikhzeenat4399 5 жыл бұрын
Can any one explain the concept of binary I didn't understood that
@deepakpatra2011
@deepakpatra2011 5 жыл бұрын
Decimal to binary conversion process
@saketsumanhello
@saketsumanhello 6 жыл бұрын
D
@progress5779
@progress5779 2 жыл бұрын
it was just 10
@catlord69
@catlord69 6 жыл бұрын
you haven't specified output type (printf ("%s",....) )
@XeartyBG
@XeartyBG 6 жыл бұрын
That's a literal. There is no need to specify type.
@Varian_t
@Varian_t 5 жыл бұрын
Wow
@parampatel3552
@parampatel3552 2 жыл бұрын
i didnt get 11 times hello world printed in code-blocks
@yellapuvennela1691
@yellapuvennela1691 6 ай бұрын
How 100 0000 0000 came for 1024
@ashishrao1789
@ashishrao1789 3 жыл бұрын
Anyone here 😀
@amar42h_
@amar42h_ Жыл бұрын
Kyu Mai computer liya 😓😓
@vishalsnsingh
@vishalsnsingh 4 жыл бұрын
So weird !
@ooss748
@ooss748 Жыл бұрын
🤪
@azteccortez4466
@azteccortez4466 Жыл бұрын
You are calling "semicolon ; " as "colon : " 🤣
@ekekelvin4655
@ekekelvin4655 10 ай бұрын
🤓👆🏾
@manalni_yevadra_apedi5602
@manalni_yevadra_apedi5602 5 жыл бұрын
You are wasting lot of time for a single concept 😉
@kaustubh.sharma
@kaustubh.sharma Жыл бұрын
Thank god this time i am right :D
@biplobbanik8296
@biplobbanik8296 6 жыл бұрын
Thanks you sir
@biplobbanik8296
@biplobbanik8296 6 жыл бұрын
Sir please make a video series of data structures
@techadil5808
@techadil5808 6 жыл бұрын
Thanks
Conditionals and Loops (Solved Problem 2)
5:18
Neso Academy
Рет қаралды 181 М.
Conditionals and Loops (Solved Problem 4)
5:41
Neso Academy
Рет қаралды 180 М.
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
Programmable Logic Devices (PLDs) | implementation of full adder using PROM, PAL and PLA
17:14
Circuitry simplified by Dr. Shobha Nikam
Рет қаралды 212
for and while Loops
6:49
Neso Academy
Рет қаралды 772 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 250 М.
Japanese||a nice exponent || olympiad mathematics||
7:37
Sahaj Maths Study
Рет қаралды 283
DeepSeek: The Free AI "Side Project" That Embarrassed ChatGPT
8:07
The Coding Sloth
Рет қаралды 28 М.