HOMEWORK QUESTIONS: 1) HOW WILL YOU EXIT IF YOU PUT SWITCH CASE INSIDE INFINITE LOOP AND WHEN YOU CAN'T USE SWITCH STATEMENT? CODE: #include #include using namespace std; int main() { //this while condition will always be true if exit( is not put.) while(1) { cout
Inside the switch-case statement: Case 1: You calculate the number of Rs.100 notes required by dividing the amount by 100 and storing the result in the variable note. You update the amount by subtracting the total value of Rs.100 notes. You print the number of Rs.100 notes required. Case 2: Similarly, you calculate the number of Rs.50 notes required. Update the amount and print the result. Case 3: You calculate the number of Rs.20 notes required. Update the amount and print the result. Case 4: You calculate the number of Rs.1 notes required. Update the amount and print the result.
your DSA course is the bestt! I already tried apni kaksha and code with harry's videos on these topics but they can nowhere reach the level of simplicity that you reach, once again thank you very much for this awesome course!
Home work 1, 14:16 using switch case in infinite loop , here we are using exit(0); there are primarily two types of exit(); 1. exit(0) which is the exit successfully which means program has run successfully and then it is terminated. i.e. program has been executed without any error or interrupt. 2. exit(1) Exit Failure: Exit Failure is indicated by exit(1) which means the abnormal termination of the program, i.e. some error or interrupt has occurred. We can use different integer other than 1 to indicate different types of errors. #include #include using namespace std; int main() { int n; cin >> n; while(INT_MIN){ switch (n){ case 1: cout
Bhai kammal ka course hai hats off to you... Previously I was thinking ki itna badi playlist hai itni lambi lambi videos hai deku ki nhi but jab maine shuru kiya bhai.. maza aa gaya. Phaze one ke sare topics maine phle se hi aate hai but har video me kuch naya sikhne ko milta hai bhai tabi phir se ari videos dekh raha hu and yes thankyou very muvh bhai ye course bane ke liye thankyou thankyou thankyou..... Jai Shree Ram
I am enjoying this course.Cannot thank you enough@babbar op hw q 2. #include using namespace std; int nofsetbit(int num) { int count=0; while(num) { if(num&1==1) { count+=1; } num=num>>1; } return count; } int main() { int a,b; cin>>a>>b;
int set_bits_in_a=nofsetbit(a); int set_bits_in_b=nofsetbit(b); cout
Bahiya ab tak iss series ki saari video dekhi hai bina ek minute skip kiye huye, har ek question khud se solve krne ka try kia hia,, my personal review till now "It is The Best DSA series out there", Mazaa aa gya,, Love you
Bro,Fibonacci wale mein sirf ik value print karwani hai yeh wala dekh le #include using namespace std; int fibonacci(int n){ int a=0; int fib=1; int b=1; int i =1; while(i>n; cout
@@shortsarena1105 bcz bhaia ne function ka return type 'bool' diya hai... aur bool data type sirf 0 ya 1 return krta hai... 1 ki jagah tum koi bhi non- zero value return karwa skte ho, but 0 ke jagah 0 hi rhne dena, usko change nhi krna... kyunki by default system kisi bhi non-zero value ko TRUE means (1) treat krta hai, aur zero ko FALSE means (0)...
This man is truly fantastic...Ek babbr indian cricket ko smhal rha hai and dusra babbr hamare Future ko.Bhai pure youtube me inse acha teacher nhi mila melo.thank you boss.i am going to subscribe to your channel.
1:07:06 Question- Find the number of set in number a and b. #include #include using namespace std; int DtoB(int m){ int i=0,ans=0; while(m!=0){ int bit=m&1; ans=bit*pow(10,i)+ans; m=m>>1; i++; } return ans; } int setbit(int n1,int n2){ string x=to_string(DtoB(n1)); string y=to_string(DtoB(n2)); string s=x+y; int count=0; for(int i=0;i>a>>b; int answer=setbit(a,b); cout
1:06:55 QUE:- Bit set #include using namespace std; int count(int n) { int bit = 0; while (n != 0) { if (n & 1) { bit++; } n = n >> 1; } return bit; } int bits(int a, int b) { int total = count (a) + count (b); return total; } int main () { int a, b; cout a; cout b; int ans =bits(a,b); cout
Bro excelleNT BUT!! how to execute program of BITSCOUUNTING if we have input a negative integer and we want to count the negative integer's bits also ?
The videos are 2 years old now, but the level that they are at, I don't think any other course on youtube is able to impart knowledge with this simplicity. Spending so much time on basics so that the base is strong is really important. Looking forward to comment on the last video that FINALLY COMPLETED THE DSA PLAYLIST!! Thanks a lott bhaiya
aaj tak functions clear hi ni hua ache se aur college ke 4th year me aagye...ab jake pura concept ekdum clear hogya just because of you bhaiyaaaa....how should I thank you SIR?🙏🙏❤❤🧡🧡🧡 You are god of millions students❤❤❤❤❤
First of all love you bhaiya for this amazing series Bhaiya currently i am in 2nd Semester and i start this C++ DSA series and today i watch this complete video lecture based on switch statement and function...
Bhaiya kya padhate ho aap 🔥 Hats off !!! Bus ese hi till end of this complete series ese hi in dept padhana .....aapka ye course aane k baad confidence aaya ..Microsoft,fb, product companies Crack karni h bus abhi toh !!! .....
25:18 // if a given amount is given to you then we have to calculate how much 100 notes,50 notes,20 notes and of 1 note it required to make the given amount #include using namespace std; int main() { int n; cout n; // n=1470 switch (1){ // (multiple switching will be there) case 1: // (for 100) int a=n/100; // a=14 int c=n%100; // temp=70 cout
// HOMEWORK 14:25 // how to exit an infinite while loop when we have a switch case inside that loop. #include using namespace std; int main() { int n; cout n; while (n) // this is an infinite loop because n is always going to be true { switch (n) // switch case enabled - to provide an output to the value of n { case 23: cout
Sir you are great..this is my first comment on RUclips 😅.. I am in btech 3rd yr and my coding was very weak now I am trying by seeing your videos it gives me hope.. Please sir solve more problems from LEETCODE.... Please sir...
Hello Zoya, Now i am in your situation. I am also in 3rd year and coding is very weak. How you prepared for placements? Did you got any job after completing this dsa series?? Please reply!!
answer of homework question --------> 26:00 #include using namespace std; int main() { int amount; int x, y, z, p, q, r, s; cout amount; switch (true) { case 1: x = amount / 100; cout
i had Cs since 11th chose ECE in college and had some coding languages there too but never got interested in learning , guess i was too lazy. Now I'm here learning DSA by babbar bhai at nights while working a 9 hour shift in sales just to change my domain as my current life sucks. Also great content so far i'm actually learning its better to learn from here than to pay thousands to some edutech companies. AGAR COLLEGE MAI HO AUR YE PAD RAHE HO TOH ABHI BHI TIME HAI CODING KRLO FAEDA HAI!
I don't know why this dsa course is so underrated even this is far better than paid course! Bhaiya the way u explain every thing repeatedly that's awesome. Concept ese hi clear ho jata hai 😎. Thank u so much for this course.
Hi bro I am looking for anyone with whom I can discuss and learn so can u give ur insta or linked or Gmail wtever if u wish or anyother if they read this comment coz community learning is the best way in coding
23:44 we don't actually need to reduce the amount rather we can do modulus int amount; cout > amount; int many = 1, note; switch(many){ case 1: { note = amount / 100; amount = amount % 100; cout
i am a third year data science student and since my major is not compsci, we were not taught core topics properly, so this serie is a little intimidating since im struggling a little with the basics,,, but im still very early as placement season doesnt start for another 6 months. i hope i am able to make great progress till the time comes. thanks for the free resources🌸
You aren't alone who's struggling to understand new concepts or basics, we are there too😪, all the best to you and all who has started this course!! Try to study or discuss topics in group which isn't clear or have doubt🤗
Discuss with your friends who incase started coding, if not then reach out people who knows, ask them, even I m newbie and I don't have that friends circle who knows coding and even in clg they don't teach well practicallg that y it is a bit difficult to manage😢
maybe i m too late to these videos but trust me i saw all the videos from scratch and moving on forward ...video was just amazing..hats off to you bhaiya!! thankyou so much for making these precious videos
First I have completed all DSA series and now conclude this is Greatest ever DSA series to exist on youtube or paid courses. Your contribution will be remembered. You're God of DSA for us🙇♂
Correct answer for time stamp : 23:44 #include using namespace std; int main() { int amount,rs100=0,rs50=0,rs20=0,rs1=0,rem=0; cin>>amount; switch(1){ case 1: rs100 = amount/100; amount=amount%100; cout
@@gamingbeastkamanager5359 because if we do 1330%100 then it will return 30 . so we will perform next operation on thirty . now if we divide 30 by 10 we get 3 notes of 10 denominations . and now if we do 30% 10 then we get 0 as reminder , so the program will be terminated.
I knew something in c++ basics before but after watching you video most important of the concept is cleared and I am feeling confident now. Thank you bhaiya ❤️
@@Reehan @Istakhar Ahmad it return but are not storing the return value in a . that's why it shows 15 . if a = update(a) is written then the return statement will be useful otherwise no meaning .
// *All Solved - **1:06:20* #include using namespace std; // Find power of number int power(int a, int b) { if (b != 0) { return (a * power(a, b - 1)); } else return 1; } // Find Arthmetic Progression int ap(int n) { return 3 * n + 7; } // Count no of 1 bits in two numbers int oneBitsInTwoNumbers(int n1, int n2) { int bits1 = 0, bits2 = 0; while ((n1 > 0) || (n2 > 0)) { bits1 = bits1 + (n1 & 1); bits2 = bits2 + (n2 & 1); n1 = n1 >> 1; n2 = n2 >> 1; } return bits1 + bits2; } // Nth Term of Fibonnaci int fibonnaciNthTerm(int n) { int a = 0, b = 1, c; for (int i = n; i != 1; i--) { c = a + b; a = b; b = c; } return a; } // MAIN FUNCTION int main() { int n = 8; cout
25:54 Homework Solution: #include using namespace std; int main(){ int amount; coutamount; int Remainder, Rs100 , Rs50, Rs20, Rs10, Rs1; switch(1){ case 1:Rs100=amount/100; Remainder=amount%100; cout
BEST VIDEO ON FUNCTIONS !! explained every thing in depth !! thank you so much bhaiya for giving this quality content !! Your explanation + this black theme is too lit
1:07:30 best way to solve the fibonacci series problem using function recursion: # include using namespace std; int febo(int number){ int a=0; if (number==0||number==1) { return 1; } else{ return (febo(number-1)+febo(number-2)); } } int main(){ int number; cout
Ansower to 1:07:10 // Find total number of set bits in input a and b #include using namespace std; int countBits(int a, int b) { int count = 0; while (a != 0) // count untill the bits of a become 0 { if (a & 1) // checking leftmost bit { count++; // if found set bit, increment count } a = a >> 1; // left shift a to check next bit in next iteration } while (b != 0) { if (b & 1) { count++; } b = b >> 1; } return count; } int main() { int a, b; cout > a; cout > b; cout
The switch case question was tricky. But was a math based problem #include using namespace std; int main() { int n, x=0,y=0,z=0,a=0; cout n; switch (1) { case 1: x += n/100; n %= 100; cout
• exit(1) krke.....aur hm infinite loop chlti tab control c bhi click kr skte h:) • void main() { int choice = 2 ; switch(choice) { case 1 : printf("In Case 1"); break; case 2 : printf("In Case 2"); continue; case 3 : printf("In Case 3"); break; } } error aayega********* Error : misplaced continue Using continue statement in switch case will throw an error because continue statement takes control to the condition checking statement again ****homework #include using namespace std; int main() { int n,rem; coutn; switch(1){ case 1: cout
Babbar bhai ap kmal hu yr no one can teach and understand the students problems like u even u know the smallest problems which a freshie face in a code .
11 months ago Home work 1, 14:16 using switch case in infinite loop , here we are using exit(0); there are primarily two types of exit(); 1. exit(0) which is the exit successfully which means program has run successfully and then it is terminated. i.e. program has been executed without any error or interrupt. 2. exit(1) Exit Failure: Exit Failure is indicated by exit(1) which means the abnormal termination of the program, i.e. some error or interrupt has occurred. We can use different integer other than 1 to indicate different types of errors. #include #include using namespace std; int main() { int n; cin >> n; while(INT_MIN){ switch (n){ case 1: cout
Answers to Last Output Questions are as follows:- 1) 10 2) 15 3) 196 Started catching up again Hope I am able to complete this Journey of becoming a Master Software Developer.
1:07:32 Set Bit Program #include using namespace std; int setbit(int a,int b) { int c=0; while(a!=0) { if(a&1) { c++; } a=a>>1; } while(b!=0) { if(b&1) { c++; } b=b>>1; } return c; } int main() { int a,b; cin>>a>>b; int d=setbit(a,b); cout
"BHAIYA UR THE BEST BASS EK """FEEDBACK""" THA THODA SA FREQUENCY BAD JATI VIDEOS KI TO MAJA AJJA ATTA ,THODA DARR LAGG RAHA HE PLACEMENT LAGI NAHI ISLIYE " BTW U REMIND ME OF MY PHY SIR
// hw problem based on fibonacci Series //code Writtern by harsh shukla #include using namespace std; int Fibonacci(int n ){ int a=0 ,b=1 ,c; for(int i = 2 ; i
Bhaiya Hatts off to your Dedication and struggle! The way you are explaining the concepts followed by the examples is helping us to get to know the concepts much easier. Though I know the concepts I'm preparing for the placements. I have gone through each and every videos you have uploaded since from the 1st video. Keep it Bhaiya!! Once again Thanking you for such an amazing content and examples.
//Homework 1:07:20 // To count and sum the Total no. of set bits( 1 ) in the binary representation of two decimal inputs. #include using namespace std; int bits(int n) { int sum = 0; while (n != 0) { if (n & 1) { sum = sum + 1; } n = n >> 1; } return sum; } int main() { int a, b; cout a >> b; cout
@@dryflame738 Bhai aur kya bolu 10th Video tak hi pohucha tha. Office ka kaam and Projects change hua toh usme focus karte karte and Family problems ki wajah se wahi par chut Gaya. Yehi Lame Excuse ha. Fir shuru karna padega yaar ab 😤😤😤😤😤😤
I used to get so confused about what to paas into the fuctions and how to call it. Thank you so much for teaching this! Recently watched the video of you achiving your dream of gifting your father a brand new car, that made my day! ❤
HOME WORK solutions 🚀 for `1:06:54` `A.P` solution : 👇 `// Arithmetic Progression int ap(int n) { int ap_formula = ( 3 * n + 7); return ap_formula; } int main() { int n; cin >> n; cout 1; } return count; } int main() { int a, b; cin >> a >> b; int total_bits = set_bits(a) + set_bits(b); cout
❤️ Sir, YOUR Series is Going on very Smoothly And Please Maintain This current Speed ...not to Fast Nor Too slow ; this is the optimised Speed and ALSO You are teaching every minute thing in that too with edge Cases that I Love about You And ALSO Your teaching style is Dope
Bhaiya I have started my career as a fresher in an org as a dotnet developer and with a hope to go to some top mnc's some day i have started this course and to be honest I have enjoyed learning till here and will work harder for the upcoming topics. Thanks for your time and efforts.
normally i am kind of lazy in comenting or liking any youtube video but bro u r helping us so much by providing us with such great content that i am being forced to do so seriousy really liking your course
Actually i want to thank you sir , we need teachers like you , after wasting my 2hrs of time in collage , i learn nothing and i watch your video and i understand the topic very well. instead of paying universities a high ammount , we have to pay teachers like you I will pray that you live infinity years . Thank you so much sir, literraly im out of depression , and you done this job , you push me to believe that i will go ahead in my life . love you sir .
HOMEWORK QUESTIONS:
1) HOW WILL YOU EXIT IF YOU PUT SWITCH CASE INSIDE INFINITE LOOP AND WHEN YOU CAN'T USE SWITCH STATEMENT?
CODE:
#include
#include
using namespace std;
int main()
{
//this while condition will always be true if exit( is not put.)
while(1)
{
cout
Kudos to you🙌
For writing that much
You are an Incredible 🙌 and so sincere student. Love Babbar Bhaiya will proud of you.
God 🙏🙏🔥
@@hodl1932 thanku so much ✨
@UCVfANS1XPuU7z4ueDOmr_2A ohh thanks Karan , it means a lot 😀
Timestamp 23:44
note example.
#include
using namespace std;
int main ()
{
int amount;
cout
You cleared my doubt thanks bro 👍🏻. Appreciated 😊.
thanks to you I now understand this switch case
thanks
@@pranjaltiwari4959 Appreciated ..
Inside the switch-case statement:
Case 1:
You calculate the number of Rs.100 notes required by dividing the amount by 100 and storing the result in the variable note.
You update the amount by subtracting the total value of Rs.100 notes.
You print the number of Rs.100 notes required.
Case 2:
Similarly, you calculate the number of Rs.50 notes required.
Update the amount and print the result.
Case 3:
You calculate the number of Rs.20 notes required.
Update the amount and print the result.
Case 4:
You calculate the number of Rs.1 notes required.
Update the amount and print the result.
your DSA course is the bestt! I already tried apni kaksha and code with harry's videos on these topics but they can nowhere reach the level of simplicity that you reach, once again thank you very much for this awesome course!
absolutely true...this guy is so positive and simple in understanding and also he has started this series from basics so its fun
Home work 1, 14:16
using switch case in infinite loop , here we are using exit(0);
there are primarily two types of exit();
1. exit(0) which is the exit successfully which means program has run successfully and then it is terminated. i.e. program has been executed without any error or interrupt.
2. exit(1) Exit Failure: Exit Failure is indicated by exit(1) which means the abnormal termination of the program, i.e. some error or interrupt has occurred. We can use different integer other than 1 to indicate different types of errors.
#include
#include
using namespace std;
int main()
{
int n;
cin >> n;
while(INT_MIN){
switch (n){
case 1: cout
note
Bro apke question me keval ek hi case chal raha hai baki nahi chal rahe hai kirpya karke apne code ko dekhe
@@hrishikeshgawde579 ok bro
Switch me 1 kyo pass kiya
@@collegematerial5348 it by default executes the code if u pass 1 cuz 1= true in binary
pass by value questions ->
1st question -> 10
2nd question -> 15
3rd question -> 196
Homework Questions- 1:06:20
1)
int nth_term(int n){
return (3*n + 7);
}
int main(){
int n;
cout n;
cout
Bhai for loop explain karoge kya wo range ?
//total no of set bit in 2 nos
#include
using namespace std;
int no_sbit(int n){
int b,s=0;
while (n!=0){
b=n&1;
s+=b;
n>>=1;
}
return s;
}
int tno_setb(int a, int b){
int ans ;
ans = no_sbit(a)+no_sbit(b);
return ans;
}
int main(){
int num1,num2;
cout > num1 >> num2;
cout
@@TheHariPutraOfficially bhai better understanding ka liya loop ko for(int i=3;i
1:08:12
homework question no. 3 of fibonacci series is
#include
using namespace std;
int fibbo(int n)
{
int a=0 , b=1 , c;
for(int i=1 ; i
please explain why we return a in fibbo function
Hi brother @@ayushpal4389
Instead of a+ b so we can get one more number in series
@@ayushpal4389 no brother fibonacci me third number previous alternative numbers ka sum hota he
@@KrishnaGupta-kw6he I know brother but we can also return a+ b so we get one more number in series
1:20:18
perfect example for understanding pass by value👍
10
Bhai kammal ka course hai hats off to you...
Previously I was thinking ki itna badi playlist hai itni lambi lambi videos hai deku ki nhi but jab maine shuru kiya bhai.. maza aa gaya. Phaze one ke sare topics maine phle se hi aate hai but har video me kuch naya sikhne ko milta hai bhai tabi phir se ari videos dekh raha hu and yes thankyou very muvh bhai ye course bane ke liye thankyou thankyou thankyou..... Jai Shree Ram
I am enjoying this course.Cannot thank you enough@babbar op
hw q 2.
#include
using namespace std;
int nofsetbit(int num)
{
int count=0;
while(num)
{
if(num&1==1)
{
count+=1;
}
num=num>>1;
}
return count;
}
int main()
{
int a,b;
cin>>a>>b;
int set_bits_in_a=nofsetbit(a);
int set_bits_in_b=nofsetbit(b);
cout
Nice I have done 1 and 3 but confusion in this u solve thanks
Plsss give the solution of question 3
@@aadilnazir8904 send me 3 plsss
26:08
#include
using namespace std;
int main(){
int amount=0,hundred=0,fifty=0,twenty=0,ten=0,one=0,modulus=0,remainder=1;
cout
Only case 1will be executive..what about others?
@@kamrulansari21 He didn't use break, so all 5 cases will be executed.
@@riteshmohanty1448 yeah later i got to know ..btw thanks buddy..
int n;
cout
Bahiya ab tak iss series ki saari video dekhi hai bina ek minute skip kiye huye, har ek question khud se solve krne ka try kia hia,, my personal review till now "It is The Best DSA series out there", Mazaa aa gya,, Love you
Homework Questions ---> 1:06:20
Q1-->
#include
using namespace std;
int APterm(int num){
int ans = 3*num + 7;
return ans;
}
int main(){
int n;
cout
your 5th code is wrong
Bhai last Wale me nth term ki value nikalni hai puri series nhi
Bro,Fibonacci wale mein sirf ik value print karwani hai
yeh wala dekh le
#include
using namespace std;
int fibonacci(int n){
int a=0;
int fib=1;
int b=1;
int i =1;
while(i>n;
cout
Bhai 43:54 me Jo return 0 aur return 1 likha hai wo kaise hua??
@@shortsarena1105 bcz bhaia ne function ka return type 'bool' diya hai... aur bool data type sirf 0 ya 1 return krta hai... 1 ki jagah tum koi bhi non- zero value return karwa skte ho, but 0 ke jagah 0 hi rhne dena, usko change nhi krna... kyunki by default system kisi bhi non-zero value ko TRUE means (1) treat krta hai, aur zero ko FALSE means (0)...
This man is truly fantastic...Ek babbr indian cricket ko smhal rha hai and dusra babbr hamare Future ko.Bhai pure youtube me inse acha teacher nhi mila melo.thank you boss.i am going to subscribe to your channel.
23:44
int n;
cout
1:22:51 HW
Q1: 10
Q2: 15 ( because we are printing "a" not "update(a)")
Q3: 196
I think q2 will give error as we are not accepting value returned by called function.
I watched the entire video and it took me 4 hrs to digest it all. and I'm happy that I invested this time to learn it.
1:07:06
Question- Find the number of set in number a and b.
#include
#include
using namespace std;
int DtoB(int m){
int i=0,ans=0;
while(m!=0){
int bit=m&1;
ans=bit*pow(10,i)+ans;
m=m>>1;
i++;
}
return ans;
}
int setbit(int n1,int n2){
string x=to_string(DtoB(n1));
string y=to_string(DtoB(n2));
string s=x+y;
int count=0;
for(int i=0;i>a>>b;
int answer=setbit(a,b);
cout
Answer thik hai par itna complex karne ki kya jarurat thi 😂
bhai kya padhate ho yaar.. awesome ❤ I have 8 years of working experience, just started your course a few days ago and these videos are really wow. :)
1:06:55
QUE:- Bit set
#include
using namespace std;
int count(int n)
{
int bit = 0;
while (n != 0)
{
if (n & 1)
{
bit++;
}
n = n >> 1;
}
return bit;
}
int bits(int a, int b)
{
int total = count (a) + count (b);
return total;
}
int main ()
{
int a, b;
cout a;
cout b;
int ans =bits(a,b);
cout
Bro excelleNT BUT!! how to execute program of BITSCOUUNTING if we have input a negative integer and we want to count the negative integer's bits also ?
Bhiyya love bhiya ne time complexity se handwritien notes nahi Dale hai aaisa kyu?
@@vaibhavmankar8178 pata nhi
1:24:47 - I'm enjoying this course. This course is very helpful. Thank you sir.
The videos are 2 years old now, but the level that they are at, I don't think any other course on youtube is able to impart knowledge with this simplicity. Spending so much time on basics so that the base is strong is really important. Looking forward to comment on the last video that FINALLY COMPLETED THE DSA PLAYLIST!!
Thanks a lott bhaiya
@armansoni3692me too
@armansoni3692 bro what about your DSA study... Have you completed the DSA
aaj tak functions clear hi ni hua ache se aur college ke 4th year me aagye...ab jake pura concept ekdum clear hogya just because of you bhaiyaaaa....how should I thank you SIR?🙏🙏❤❤🧡🧡🧡 You are god of millions students❤❤❤❤❤
🙏🙏🙏
Are Mam aapka clear to hua mera to bo bhi nhi 😂😂
First of all love you bhaiya for this amazing series
Bhaiya currently i am in 2nd Semester and i start this C++ DSA series and today i watch this complete video lecture based on switch statement and function...
Bhaiya kya padhate ho aap 🔥 Hats off !!! Bus ese hi till end of this complete series ese hi in dept padhana .....aapka ye course aane k baad confidence aaya ..Microsoft,fb, product companies Crack karni h bus abhi toh !!! .....
ruclips.net/video/zM6G0gOVP58/видео.html
git and github tutorial
Kaha ho Bhai abhi
Bhai tu kaha hai aaj ??
@@aaravanand2325 developer at IDFC First Bank
great....man@@avibirla9863
1:22:54 Output 1: 10, Output 2: 15, Output 3: 196
Sure?
can u please help me in question 2
why only 15 gets printed.
in update function we return a = a-5;
so the answer should be 10 and 15 both
@@Reehan bhai value return ho rhi update me par initialize nai ho rhi hai kahi bhi ..to us return ka koi matlab hi nai raha
@@Reehan basics clear krne hai to saurabh shukla sir ke lectures dekh lo
@ 1:08:04 hw que solution
CPP:
#include
using namespace std;
int fibonacci( int n){
int fib0 = 0;
int fib1 = 1;
int fib;
cin>> n;
for(int i =1; i
25:18
// if a given amount is given to you then we have to calculate how much 100 notes,50 notes,20 notes and of 1 note it required to make the given amount
#include
using namespace std;
int main() {
int n;
cout n; // n=1470
switch (1){ // (multiple switching will be there)
case 1: // (for 100)
int a=n/100; // a=14
int c=n%100; // temp=70
cout
// HOMEWORK 14:25
// how to exit an infinite while loop when we have a switch case inside that loop.
#include
using namespace std;
int main()
{
int n;
cout n;
while (n) // this is an infinite loop because n is always going to be true
{
switch (n) // switch case enabled - to provide an output to the value of n
{
case 23:
cout
Code is good it should work because i also tried viewing your problem but didn’t stuck in any loop 😇
Try saving and running again !!
1:06:50 answer of que :1 is
int ap(int n){
int ans=1;
for(int i=0;n>=i;i++){
ans=(3*n+7);
}
return ans;
}
int main(){
int n;
cin>>n;
cout
Sir you are great..this is my first comment on RUclips 😅.. I am in btech 3rd yr and my coding was very weak now I am trying by seeing your videos it gives me hope.. Please sir solve more problems from LEETCODE.... Please sir...
Hello Zoya, Now i am in your situation. I am also in 3rd year and coding is very weak. How you prepared for placements? Did you got any job after completing this dsa series??
Please reply!!
@@deetan1550 bhai mili
got placement?
*Home Work*
#include
using namespace std;
15:24 Use exit() in infinite loop inside switch.
int main() {
cout
thanku so much for answer,
Bro output kay q.2 may 15 ayga
learn dsa from imran khan..... what are you doing here
@@rishabhchaudhary6207 hahaha I Lough so hard...
I wish he know this 😁😁
@@iUmerFarooq
I know because he is a beggar 😂😂😂😂
answer of homework question --------> 26:00
#include
using namespace std;
int main()
{
int amount;
int x, y, z, p, q, r, s;
cout amount;
switch (true)
{
case 1:
x = amount / 100;
cout
i had Cs since 11th chose ECE in college and had some coding languages there too but never got interested in learning , guess i was too lazy.
Now I'm here learning DSA by babbar bhai at nights while working a 9 hour shift in sales just to change my domain as my current life sucks.
Also great content so far i'm actually learning its better to learn from here than to pay thousands to some edutech companies.
AGAR COLLEGE MAI HO AUR YE PAD RAHE HO TOH ABHI BHI TIME HAI CODING KRLO FAEDA HAI!
have you learnt dsa?
plz reply
how much do you earn in your current job???
@@bhupeshgupta4476 36 lpa
@@rudripancholifc 😃 great
I don't know why this dsa course is so underrated even this is far better than paid course! Bhaiya the way u explain every thing repeatedly that's awesome. Concept ese hi clear ho jata hai 😎. Thank u so much for this course.
Hi bro I am looking for anyone with whom I can discuss and learn so can u give ur insta or linked or Gmail wtever if u wish or anyother if they read this comment coz community learning is the best way in coding
@@rakshithml4631 Hi Rakshith! I just started this DSA course and am searching for such a group for discussions!
@@shibashisdeb4136 abhi start kiye ho kya bhai
@@shibashisdeb4136 me too
bhai tu mera roomate hai kya ?
23:44 we don't actually need to reduce the amount rather we can do modulus
int amount;
cout > amount;
int many = 1, note;
switch(many){
case 1: {
note = amount / 100;
amount = amount % 100;
cout
Homework at timestamp:1:08:01 in python
1 st:
def ap(n):
arithmatic = 3*n+7
return arithmatic
2nd:
def bit(a):
count=0
while(a!=0):
if(a & 1):
count+=1
a = a>>1
return count
def count(a,b):
c = bit(a)+bit(b)
return c
3rd:
def fibonaaci(n):
f=0
s=1
num=0
for i in range(2,n):
num =s+f
f=s
s=num
return s
i am a third year data science student and since my major is not compsci, we were not taught core topics properly, so this serie is a little intimidating since im struggling a little with the basics,,, but im still very early as placement season doesnt start for another 6 months. i hope i am able to make great progress till the time comes. thanks for the free resources🌸
You aren't alone who's struggling to understand new concepts or basics, we are there too😪, all the best to you and all who has started this course!! Try to study or discuss topics in group which isn't clear or have doubt🤗
Discuss with your friends who incase started coding, if not then reach out people who knows, ask them, even I m newbie and I don't have that friends circle who knows coding and even in clg they don't teach well practicallg that y it is a bit difficult to manage😢
hey lets connect to discuss the ques and exchange doubt bcz i hv started and its kind of difficult
@@sashavlogs24 okayy where to contact sasha
From which college ?
1:22:52 update(a) = 5
orginal value of a is 5
1:22:55 update (a) = 10
original value is 15
1:22:57 a is 196
maybe i m too late to these videos but trust me i saw all the videos from scratch and moving on forward ...video was just amazing..hats off to you bhaiya!! thankyou so much for making these precious videos
How to practice dsa with the help of this course?
First I have completed all DSA series and now conclude this is Greatest ever DSA series to exist on youtube or paid courses. Your contribution will be remembered. You're God of DSA for us🙇♂
hey dude can you provide us with notes of these lectures plz agr bnaye h toh kyunki starting ki kuch videos k baad notes nahi h
24:50
#include
using namespace std;
int main(){
int num;
coutnum;
int rs100,rs50,rs20,rs1;
switch(1){
case 1:
rs100=num/100;
num = num%100;
cout
Correct answer for time stamp : 23:44
#include
using namespace std;
int main() {
int amount,rs100=0,rs50=0,rs20=0,rs1=0,rem=0;
cin>>amount;
switch(1){
case 1: rs100 = amount/100;
amount=amount%100;
cout
Switch (1)
1 kyu aayea
what an awesome way of teaching i am a pharmacy graduate learning coding from Love Babbar, kudos to you brother.
int n,a,b,c,d;
cout
Homework 23:44
int main() {
int n;
cout
thanks bro
why are we calculating % here?
@@gamingbeastkamanager5359 bro % is used to find remainder
Like 11%5 is 1
@@abhijitkore7040 i know but why are we calculating the remainder here ?
@@gamingbeastkamanager5359 because if we do 1330%100
then it will return 30 .
so we will perform next operation on thirty .
now if we divide 30 by 10 we get 3 notes of 10 denominations .
and now if we do 30% 10
then we get 0 as reminder , so the program will be terminated.
I knew something in c++ basics before but after watching you video most important of the concept is cleared and I am feeling confident now. Thank you bhaiya ❤️
HW 25:00
int amount = 1330;
int start=1;
cout
salam,man can you please elaborate me your code like why you use 1stly (/) and then % operator and start =1 always true????
COMPLETED AT 23:33
ON 12-12-2022
LIKED IT VERY MUCH:)
NEXT TARGET: Lec#9 BEFORE SLEEPING⚡🌟
No One Asked
@@limitedwords9020 no one asked to you too
@@rmy5445 and no one even asked you to reply
and noone asked you to comment @@limitedwords9020
HW= 1-10
2-15
3-196
saHI HAI BOSS
can u please help me in question 2
why only 15 gets printed.
in update function we return a = a-5;
so the answer should be 10 and 15 both
@@Reehan @Istakhar Ahmad it return but are not storing the return value in a . that's why it shows 15 . if a = update(a) is written then the return statement will be useful otherwise no meaning .
// *All Solved - **1:06:20*
#include
using namespace std;
// Find power of number
int power(int a, int b)
{
if (b != 0)
{
return (a * power(a, b - 1));
}
else
return 1;
}
// Find Arthmetic Progression
int ap(int n)
{
return 3 * n + 7;
}
// Count no of 1 bits in two numbers
int oneBitsInTwoNumbers(int n1, int n2)
{
int bits1 = 0, bits2 = 0;
while ((n1 > 0) || (n2 > 0))
{
bits1 = bits1 + (n1 & 1);
bits2 = bits2 + (n2 & 1);
n1 = n1 >> 1;
n2 = n2 >> 1;
}
return bits1 + bits2;
}
// Nth Term of Fibonnaci
int fibonnaciNthTerm(int n)
{
int a = 0, b = 1, c;
for (int i = n; i != 1; i--)
{
c = a + b;
a = b;
b = c;
}
return a;
}
// MAIN FUNCTION
int main()
{
int n = 8;
cout
25:54
Homework Solution:
#include
using namespace std;
int main(){
int amount;
coutamount;
int Remainder, Rs100 , Rs50, Rs20, Rs10, Rs1;
switch(1){
case 1:Rs100=amount/100;
Remainder=amount%100;
cout
BEST VIDEO ON FUNCTIONS !! explained every thing in depth !! thank you so much bhaiya for giving this quality content !!
Your explanation + this black theme is too lit
1:07:30
best way to solve the fibonacci series problem using function recursion:
# include
using namespace std;
int febo(int number){
int a=0;
if (number==0||number==1)
{
return 1;
}
else{
return (febo(number-1)+febo(number-2));
}
}
int main(){
int number;
cout
Sir,series is going very smoothly and I'm able to understand these topics
Thank you so much for giving this content free of cost..!❤
Ansower to 1:07:10
// Find total number of set bits in input a and b
#include
using namespace std;
int countBits(int a, int b)
{
int count = 0;
while (a != 0) // count untill the bits of a become 0
{
if (a & 1) // checking leftmost bit
{
count++; // if found set bit, increment count
}
a = a >> 1; // left shift a to check next bit in next iteration
}
while (b != 0)
{
if (b & 1)
{
count++;
}
b = b >> 1;
}
return count;
}
int main()
{
int a, b;
cout > a;
cout > b;
cout
you can solve it using only a single while loop which reduces its time complexity @@meetmakwana3427
OUTPUT ANS:-
1) 10
2) 15
3) 196
second 15 hai kya
Mera to 10 aarha because jo function h vo value return kr rha hai baki pta ni shi h ya galat mera please help me
@@CSEStudent777 haan bro..
Bhai second m error nii aayga ky ?? kyuki function ek int reurn kr ra h aur usko koi holding value bi to chahiye na usi data type ki...
second ka 15 kaise aya?
57:10 i
Bhaiyaa Itna Valuable course aapne banaya hai thanks fro that 100% free with full concept crystal clear I really love your videos😊😊
Finally, understood the functions
Well explained with each detail.
code :
#include
using namespace std;
int main(){
int amount;
coutamount;
switch(1){
case 1:{
int h=amount/100;
amount=amount%100;
cout
The switch case question was tricky. But was a math based problem
#include
using namespace std;
int main() {
int n, x=0,y=0,z=0,a=0;
cout n;
switch (1)
{
case 1:
x += n/100;
n %= 100;
cout
excellent solution brother, thanks for help
lecture 8 ✔
it always feel so good after learning such concepts in depth.
i love you
HW (25:00)
int main(){
int amount;
cout amount;
int n100, n50, n20, n1; // no. of notes
n100 = n50 = n20 = n1 = 0; // initialize
switch(1){
case 1:
n100 = amount/100;
amount %= 100;
if (amount == 0){break;}
case 2:
n50 = amount/50;
amount %= 50;
if (amount == 0){break;}
case 3:
n20 = amount/20;
amount %= 20;
if (amount == 0){break;}
default:
n1 = amount;
break;
}
cout
• exit(1) krke.....aur hm infinite loop chlti tab control c bhi click kr skte h:)
• void main()
{
int choice = 2 ;
switch(choice)
{
case 1 :
printf("In Case 1");
break;
case 2 :
printf("In Case 2");
continue;
case 3 :
printf("In Case 3");
break;
}
}
error aayega*********
Error : misplaced continue
Using continue statement in switch case will throw an error because continue statement takes control to the condition checking statement again
****homework
#include
using namespace std;
int main() {
int n,rem;
coutn;
switch(1){
case 1: cout
2nd mcq ka answer 15 aayega bro
Watching this video dec17 2023 ... awesome video sir 👍😎
Bro will you be my codechef partner ? if you are consistent
@@CodeWithCuriosity i am just a beginner....if don't have a problem with that ...then we are good to go 👍
@@soumyajyotirouth5134 hi,even i am in
@@soumyajyotirouth5134 iam also beginner
Is there space for a beginner also 🙋
Babbar bhai ap kmal hu yr no one can teach and understand the students problems like u even u know the smallest problems which a freshie face in a code .
For fibonacci's nth term:
include
using namespace std;
int term(int n){
int a=0,b=1;
for(int i=1; i>num;
if (num==1){
cout
Loving this DSA series !! All the concepts are getting cleared.
11 months ago
Home work 1, 14:16
using switch case in infinite loop , here we are using exit(0);
there are primarily two types of exit();
1. exit(0) which is the exit successfully which means program has run successfully and then it is terminated. i.e. program has been executed without any error or interrupt.
2. exit(1) Exit Failure: Exit Failure is indicated by exit(1) which means the abnormal termination of the program, i.e. some error or interrupt has occurred. We can use different integer other than 1 to indicate different types of errors.
#include
#include
using namespace std;
int main()
{
int n;
cin >> n;
while(INT_MIN){
switch (n){
case 1: cout
Answers to Last Output Questions are as follows:-
1) 10
2) 15
3) 196
Started catching up again Hope I am able to complete this Journey of becoming a Master Software Developer.
us bro us
@@anandrajdubey1873 yep Keep it going every single day. Upcoming 3 lectures will be tough as hell but interesting
તમે સારું કામ કરી રહ્યાં છો 🙏
Please keep going on 🙏
Your concepts is easy and very effective for students 👌
ruclips.net/video/zM6G0gOVP58/видео.html
git and github tutorial
Ho bhai
1:07:32
Set Bit Program
#include
using namespace std;
int setbit(int a,int b)
{
int c=0;
while(a!=0)
{
if(a&1)
{
c++;
}
a=a>>1;
}
while(b!=0)
{
if(b&1)
{
c++;
}
b=b>>1;
}
return c;
}
int main()
{
int a,b;
cin>>a>>b;
int d=setbit(a,b);
cout
Completed !!! 24 /08/23 @2:26 am , the effort you made to create this content is inspiration for the learner
26 aug @3:55
Lec 8 ✔️
"BHAIYA UR THE BEST BASS EK """FEEDBACK""" THA THODA SA FREQUENCY BAD JATI VIDEOS KI TO MAJA AJJA ATTA ,THODA DARR LAGG RAHA HE PLACEMENT LAGI NAHI ISLIYE " BTW U REMIND ME OF MY PHY SIR
Bhai konse sem mein h?
@@gangsterop9034 8th
@@Aditya_khedekar revise kar rha h kya
DSA ?
Anyways all the best.
@@Aditya_khedekar placement lg gyi??
@@jaydeep_pro t€®i lag gyi kya bro?
// hw problem based on fibonacci Series
//code Writtern by harsh shukla
#include
using namespace std;
int Fibonacci(int n ){
int a=0 ,b=1 ,c;
for(int i = 2 ; i
Content quality is awesome.... .....
I ❤ this course.
Thanku you sir
We can also use GOTO statement to exit the while loop. 15:30
What to write butmm
23:44
int main() {
int amount;
cin >> amount;
int notes100 = 0, notes50 = 0, notes20 = 0, notes10 = 0;
switch (1) {
case 1:
notes100 = amount / 100;
amount %= 100;
case 2:
notes50 = amount / 50;
amount %= 50;
case 3:
notes20 = amount / 20;
amount %= 20;
case 4:
notes10 = amount / 10;
amount %= 10;
}
cout
Bhaiya Hatts off to your Dedication and struggle! The way you are explaining the concepts followed by the examples is helping us to get to know the concepts much easier. Though I know the concepts I'm preparing for the placements. I have gone through each and every videos you have uploaded since from the 1st video. Keep it Bhaiya!! Once again Thanking you for such an amazing content and examples.
Thank you for making such an amazing video! so far I have watched all your videos, hope I'll stick till the end of the series.
//Homework 1:07:20
// To count and sum the Total no. of set bits( 1 ) in the binary representation of two decimal inputs.
#include
using namespace std;
int bits(int n)
{
int sum = 0;
while (n != 0)
{
if (n & 1)
{
sum = sum + 1;
}
n = n >> 1;
}
return sum;
}
int main()
{
int a, b;
cout a >> b;
cout
Thanku so much bhaiya for making my concepts more strong and vivid:)
Please add handwritten notes , it will help a lot, it's a humble request
Calculator 18.08
#include
using namespace std;
int main(){
int a,b,ope;
cout
Present! Bhaiya please course ko consistent rakhe!!
Placements aarhe hai as I'm in third year :)
ruclips.net/video/zM6G0gOVP58/видео.html
git and github tutorial
Me too
bro i wanted to ask you something, how can we connect?
BHaiya your series is going to change our future 😍 You are awesome bhaiya☺ Love from Maharashtra❤
You are my favourite teacher brother ❤
Completed 8th Video from start to Finish with all codes solved. Can't wait to Reach video number 149 in this Series. Loving the Journey so far.
Kaha tak pohche bhai
@@dryflame738 Bhai aur kya bolu 10th Video tak hi pohucha tha. Office ka kaam and Projects change hua toh usme focus karte karte and Family problems ki wajah se wahi par chut Gaya. Yehi Lame Excuse ha. Fir shuru karna padega yaar ab 😤😤😤😤😤😤
I used to get so confused about what to paas into the fuctions and how to call it. Thank you so much for teaching this! Recently watched the video of you achiving your dream of gifting your father a brand new car, that made my day! ❤
23:45
#include
using namespace std;
int main() {
int total_amount, left_amount;
cout total_amount;
left_amount = total_amount;
switch ( 100 )
{
case 100 : if(total_amount >= 100) {
int no_of_notes = total_amount/100;
cout b;
ans = count_setbits(a);
ans += count_setbits(b);
cout n;
if(n
Efforts are increasing day by day...n I'm enjoying the series
Your videos are giving us a different level of satisfaction...The Best
HOME WORK solutions 🚀
for `1:06:54` `A.P`
solution : 👇
`// Arithmetic Progression
int ap(int n) {
int ap_formula = ( 3 * n + 7);
return ap_formula;
}
int main() {
int n;
cin >> n;
cout 1;
}
return count;
}
int main() {
int a, b;
cin >> a >> b;
int total_bits = set_bits(a) + set_bits(b);
cout
❤️ Sir, YOUR Series is Going on very Smoothly And Please Maintain This current Speed ...not to Fast Nor Too slow ; this is the optimised Speed and ALSO You are teaching every minute thing in that too with edge Cases that I Love about You And ALSO Your teaching style is Dope
bro how was your experience in this series
if any suggestion pls reply to me
Bhaiya I have started my career as a fresher in an org as a dotnet developer and with a hope to go to some top mnc's some day i have started this course and to be honest I have enjoyed learning till here and will work harder for the upcoming topics. Thanks for your time and efforts.
15:30
#include
using namespace std;
int main() {
while(1){
int n=2;
switch(n){
case 1:cout
normally i am kind of lazy in comenting or liking any youtube video but bro u r helping us so much by providing us with such great content that i am being forced to do so seriousy really liking your course
Sir can you please provide Handwritten Notes For Every lecture as this helps to understand things and for revision as well. Thank you
Actually i want to thank you sir , we need teachers like you , after wasting my 2hrs of time in collage , i learn nothing and i watch your video and i understand the topic very well. instead of paying universities a high ammount , we have to pay teachers like you I will pray that you live infinity years . Thank you so much sir, literraly im out of depression , and you done this job , you push me to believe that i will go ahead in my life . love you sir .
Thanks a lot for this awesome content providing for free bhaiya, really hats off for u bhaiya.❤🙏🔥