You have a great great stamina teaching every single thing so precisely.
@chester04152 жыл бұрын
Sir i understood everything you said.exept the curval=val cnt=1. Inside the else statement.
@СарварбекКабулов-к9я Жыл бұрын
same
@user-qs1ez1ko5f Жыл бұрын
That is to ensure the program uses the "else"-case val as its currVal reference point when it loops back to compare with the next std::cin >> val. Otherwise it would continue reading 10 10 8 8 as just 10 10 10 10 because nothing ever changed the currVal stated at the beginning of the script. And count goes back to one to start the count fresh for this new reference number (currVal = 8, ct =1 during the end of the third while loop in my example).
@GammaVideosable3 жыл бұрын
Thank you, very informative and well explained ! 👍
@LeonardNjuguna-l3b7 ай бұрын
it was the fist one to pose a challenge, but Thankyou. Perfect explanation
@ledschmidt144111 ай бұрын
Well I've followed several of your programs and they are precise and work well. Your detail is superb.... NOW when it comes to this particular one, I think we should tell the USER, to enter the numbers using the space bar Between entries, if you enter a number then hit the ENTER key, the program gets confused and the numbers go in vertically which we do not want. Ok?
@tayyab.sheikh Жыл бұрын
This program is Fine 👍🏽 but we want to know the thought process behind the program, how did you made the logic from scratch. Please make a video on logic building 🙏🏽
@farhanahassan838911 ай бұрын
Read the c++ primer book
@421-r.venkateshnaik73 жыл бұрын
Anna We need C programme from beginning to end with deep concepts & examples anna.....
@jallipallisaipraveenkumar18013 жыл бұрын
Fantastic mind blowing unbelievable. Amma Baboi🔥🔥🔥
@gaganpatrobammidi30052 жыл бұрын
Recordlu theragesthadhi 😀
@touseef_akhtar2 жыл бұрын
Why are all the COUTs appearing after entering all the numbers?? Should not it appear as soon as we enter a different number from the previous one as per the code? Please guide
@Martin958 Жыл бұрын
@touseef_akhtar I had the same thought. I could not see why the last numbers would not overwrite the previous ones that are input. But if you watch, he enters all the numbers at the same time on one single input line. That means they all get processed in the while loop as one long feed, hence they do not overwrite one another. So, the while loop can generate a separate message for each group of consecutive numbers, and only stops when you enter an end of file value.
@rajeshprajapati6662 Жыл бұрын
On Stackoverflow : Difference between entering values in cin using spacebar and enter key?
@chester04152 жыл бұрын
You are an angle sir.if you war'nt the one teaching than i would have never understood this cause you know i am only 14.
@siddeshwarapm56132 жыл бұрын
Best lecture. and defining.
@tadelemesfin25582 жыл бұрын
Amazing lecture.
@sachinsudaraka63973 жыл бұрын
Thanks
@Light13378 Жыл бұрын
Why in second time is not 2 time equals to in currval = val
@batchuamarnathguptha33643 жыл бұрын
sir please make regular videos on c++
@srinivasaraob28903 жыл бұрын
It is very difficult to wait for long time sir please make sure that videos are regular . Thank you.
@matbarjoshi78913 жыл бұрын
yeah same
@chester04152 жыл бұрын
It takes a a lot of effort explaining every single thing precisely.
@rajkumarsaraboju17563 жыл бұрын
Sir please make regular videos on C++
@Pooja-ch1hl3 жыл бұрын
please make python playlist
@LVC85costa11 ай бұрын
So the first input goes into the if and changes currVal as long as its an int, therefore the if body works. Is that enough to make the cin not update currVal again, because its in the IF? I guess I'm confused as to why the second int input goes into the WHILE that's inside the IF. That's the only part I don't fully get. I am going to look at it for a few more minutes. Thanks for the lesson.
@MohitKumar-kr8wk3 жыл бұрын
Plz make regular video on C++ sir
@sloughpacman Жыл бұрын
Good video, buggy program. Of course, you never get the character count for the last entry because the program never identifies it as the last repetition in the sequence, unless an EOF char such as 'a' is used. Returning a sequence of valid numbers alone or ending them with the ^D EOF char on Linux is merely a program interrupt that does not output the sequence count for the final number and terminate the program - you can of course continue entering more valid numbers after the interrupt to get the missing line, but the program then becomes unending and you never get the new final line. This why everyone uses Python for simple programs, because tying up all those loose ends with C++ is only worth it for large complex systems!!! You can experiment with ChatGPT to build a C++ program for the required task, and then have it do the same with Python. The Python code is far, far simpler. I love these almost philosophical discussions about C++ because you can see that by design it is not intended to end and therefore has mostly 'always on' use cases.
@SurajPandey-vi9gr11 ай бұрын
wdym in a nutshell ?
@mohitzen3 жыл бұрын
I am unable to print the number of occurrences of the last entry even after writing the cout statement after end of else { }. Please help out.
@陳嘉宇-y4q2 жыл бұрын
same goes with me, there's a bug in the code I guess
@rajeshprajapati6662 Жыл бұрын
I had to press Ctrl D two times, one for While loop and another for If condition. After that, everything appears fine.
@rajeshprajapati6662 Жыл бұрын
Did you try on Windows ?
@afanoromolyricsofficial2 жыл бұрын
done!
@mohitnamdev73232 жыл бұрын
i worked out the exact same code you showed but it is not working accordingly: can someone please help: code #include using namespace std; int main() { int cur, val, count; cur=0; val=0; if (cin >> cur) { int count = 1; while (cin>>val) { if (val==cur) { ++count; } else{ cout
@handle_gc2 жыл бұрын
You redefined count 2 times
@SurajPandey-vi9gr11 ай бұрын
@@handle_gc that's what the tutor has done
@johnsumith21072 жыл бұрын
For storing multiple numbers val should be array right??
@NocturnalCoder0222 жыл бұрын
no it just acts as a buffer element
@AlokSingh-gl6hz3 жыл бұрын
Why ur video come late plz upload video in regular frequency
@malaythakur43803 жыл бұрын
please upload video ASAP. please sir.
@nesoacademy3 жыл бұрын
Yes, we’re working on the upcoming lectures.
@malaythakur43803 жыл бұрын
@@nesoacademy Thanks ❤️
@mrnavi1883 жыл бұрын
✌🏻sir when we will give input 5 5 5 4 5 6 it will give ouput 5 occures 3 times 4 occures 1 times 5 occures 1 times 6 occures 1 time But sir it isn't adding them 5 consecutive 5 occures 4 times
@nofreewilltakethepill3 жыл бұрын
5 occurs 3 times consecutively. The other input of five, don't belong to the chain of consecutive fives. I hope I made myself clear
@abhisaragarwal90842 жыл бұрын
Do it with array and then itterate it to check with if condition
@NocturnalCoder0222 жыл бұрын
@@nofreewilltakethepill yes, appreciable
@AziaAbdi5 ай бұрын
Really I don't understand this lesson any help
@bhanupratap-qj4lp3 жыл бұрын
Sir please a request don't provide upcoming videos for cost plz make this complete course free of cost 🙏🙏as I am not able to afford price for 1 month as 200 it's literally high for a single month.This course is need of everyone preparing for interviews of some good companies 🙏🙏
@Kill2967 ай бұрын
#include using namespace std; int main() { int val=0 , currval=0; int count; if(cin >> currval) { count = 1; while(cin >> val) if (val == currval) { ++count; } else { cout
@xtreameidea31263 жыл бұрын
🔥🔥🔥🔥🔥🔥
@DalandanReal3 ай бұрын
Dude I don't think the outer if condition needs to be there it's unnecessary it confused the people wants to learn
@rajubhai-vf3nk2 жыл бұрын
thank you so much sir. but am unable to run this program output get wrong. please help.
@SurajPandey-vi9gr11 ай бұрын
very confusing.
@freewifi81473 жыл бұрын
liked
@savin88783 жыл бұрын
💞💞💞💞💞💞🙏
@farhanahassan838911 ай бұрын
These videos are all copied from the C++ primer book. Sad, very sad.