Taking an array from the user would mean using variable size for the array. If you guys are not using vs code or codeblock you will see an error where the comipiler is asking for a constant instead of n. So instead of using : int n; cin>>n; int arr[n]; for(int i=0; i>arr[i]; Use : int n; cin>>n; int *arr = new int[n]; for(int i=0; i>arr[i];
Bhai ye tera suggestion mai actually mai koi sense nahi banta bcoz bhaiya ki team mai 7 to 8 members hai aur doubts puch wale students thousands ya lakhs mai hai
for those who are using Microsoft Visual and getting input array size error. you have to initiate dynamic array instead of static array. #include #include using namespace std; int main() { int n; cout > n; int *arr{ new int[n] }; for (int i=0; i < n; i++) { cin >> arr[i]; } for (int i=0; i < n; i++) { cout
I'm the first viewer💪🏻🔥... Bhaiya aapne aag lga rkhi hai...!!🔥 And thanks di aap bhott acha explain karte hoo🔥🔥💪🏻 thank you so much other team members 💪🏻🔥❤️
very helpful videom thank u for the hard work for us, which is helping me and lakhs of students. very fortunate to recieve videos for no price. i would like to contribute back to apna college
thanks a lot as compared to two bhaiya in previous 2 videos you're far better then those bhaiya and explain the concept very easily they may be good programmers but teaching to others is a different thing and i think you're pretty good on it.
Practice Question 2 : kid with the greatest no. of candies........(assuming the kid numbering starts from 1) #include using namespace std; //kid with max number of candies int maxcandy(int demoarray[], int n){ int maxi=demoarray[0]; for(int i=0; i
the explanations seem a little rushed, Like the reasons for doing certain steps are not explained clearly which makes it hard for beginners like me to understand. other than that I Love this series, it has helped me so much!!! thank you!
when we take maxNo=INT_MIN, we are assigning the variable maxNo with the lowest possible value in c++. So now, any value from the array will be greater than this value, and will simply get assigned first. So maxNo will never be equal to INT_MIN. And for each element in the array, we are going to check if it is greater than the current maxNO value or not, and if it is, maxNo then gets updated.
Bro the logic behind it is.. int maxNo = INT_MIN int minNo = INT_MAX You know na, there is a inbuilt function max and min. so maxNo = max(arr[i],maxNo) . Here arr[i] should be greatest. and in int maxNo ,the number to be stored should be the smallest . So int_min is stored in maxNo because its the min . So if we compare max(arr[i],maxNo), here maxNo is smaller than arr[i].. and max function finds the greatest number bewteen this. arr[i] > maxNO; So arr[i] is printed in max .. Similarly reverse it in min function. You will get the answer. Just sit for 2mins and think it logically. hope it is useful.
@@Biliphang088 bhai tera 2nd para dekh wo bas if statement ko khatam karne ke lie h to uska isse koi logic nahi h. #important for all Sunna dd ne kya bola h, int_min aur int_max ke bare me (jab wo if statement likhi thi) maximum pane ke lie agar int_min agar kisi se choto hoga to wah update hoga(read again) mtlb wo aage badh jaega or aage chek karega min se max jane ke lie usi tarah iska ulta dekh sab samjh me aajaega
*Answer* of practice question 2 i.e. GIVEN IN THE NOTES #include using namespace std; int main() { int kids,i, maximum=0; coutkids; string NameOfKids[kids]; int CandyOfKids[kids]; cout
9:48 Instead of assigning INT_MIN to maxNo and INT_MAX to minNo, We should assign arr[0] to both of them as we are comparing the elements of array only
I'm from AHSEC board Book : computer science and application by Dr. Diganta Das Q. Can I use other header file as the climits header file wasn't use in there and in practical they use turbo c++..? recommed me alternative header file please !!
Isn't that a bad practice to initialize Static Arrays with a variable(like 'n' in this case) because Static arrays have to be initialized with a Constant Value? Clang and MingW may allow u to do that but if you try to do this on Microsoft Visual C++ that will throw a Compilation Error and Program Crashes. The Error is stated as: *expression must have a constant value -- the value of variable "n" (declared at line 5) cannot be used as a constantC/C++(28)*
#include using namespace std; int main (){ int a ; int sun = 0; cin >> a; int array[a]; for(int i = 0; i < a ; i++){ cin >> array[i] ; } for(int n = 0; n < a ; n++){ sun += array[n]; } cout
// we can initialize min and max with the first element and start the loop from 1 (current me if I am wrong here, thanks in advance) private static void mainAndMaxInArray(int[] arr) { int min = arr[0], max = arr[0]; for (int i = 1; i < arr.length; i++) { if (min > arr[i]) { min = arr[i]; }else if(max < arr[i]){ max = arr[i]; } } System.out.println(max +"::::"+ min); }
Thank you. edit : bas ek chota sa doubt tha.....maine jab C programming mai array declare karna seekha tha to usme hame pehle hi array size batani padti thi, so is this a new feature that C++ has in which we can get the size of the array from the user during runtime without using malloc and stuff?
Awesome lecture!! The practice questions link isn't opening. please see. And also in the notes, lec 7.1 is titled as 8.1 and now 8.1 is titled as 9.1 thanks again @Apna College
MY APROACH FOR MIN MAX PROBLEM: int main(){ int n, min, max; cout> n; int ages[n]; for (int i = 0; i < n; i++){ cin>> ages[i]; } min = ages[0]; max = ages[0]; for (int i = 1; i < n; i++){ if(max < ages[i]){ max = ages[i]; } else{ if (min > ages[i]){ min = ages[i]; } } } cout
I like the confidence she has when she deliver the lectures..
Finally didi is back again 🥰🥰
Bhaiya after reading this comment : Soka?
Simp
@@vinayakmate693 oh i almost forgot that I used to watch this course 😅😅
Not a simp though 😂
@@aryansharma-wf8sn wait does that mean this is not worth remembering or what?
@@hrithikpandey1482 no no it is a really great course, but I just got busy in some other stuff lately so I stopped watching it
Taking an array from the user would mean using variable size for the array.
If you guys are not using vs code or codeblock you will see an error where the comipiler is asking for a constant instead of n.
So instead of using :
int n;
cin>>n;
int arr[n];
for(int i=0; i>arr[i];
Use :
int n;
cin>>n;
int *arr = new int[n];
for(int i=0; i>arr[i];
Thank goodness, someone else has encountered the same issue. 😅
Conclusion: Rahul is a player
No, I am not🙄
sunn meri baat, it's his choice!!😂😂
@@rahull9155 You are impostor
@@tech_wizard9315 rahul looks sus
Are😆😆😆😂😂😂😂😂
When I play video and lesten the voice i be like : कहां थे आप ....😂❤️🔥👍🏻
Are bhai bhai
pucha kisi ne?
@@AbhinavKumar-ri8zi kuch baatein puchi nhi jati *laxman 😁👍🏻
nakkliiiii
ruclips.net/video/5FsIa4Mp3ho/видео.html🙏🏻🙏🏻🙏🏻
bhaiya ek suggestion hai.
Har week ke end me ek doubt session related to this course livestream kar dijiye.
jisko jisko ye chahiye like karo.
tu rk kaam kar free me bhai ki jaydad bhi maangle
@@otm_empire mtlb koi ab kuch suggests bhi na kare?
Bhai ye tera suggestion mai actually mai koi sense nahi banta bcoz bhaiya ki team mai 7 to 8 members hai aur doubts puch wale students thousands ya lakhs mai hai
@kapil 9999 🤝🏻theek hai bhai
glti ho gayi mafi patr likh deta hu unko
Urvi Mam is lub❤️.
Aap hi pdhte rho🙏
Amazing c++ course
Every one have to watch and learn this course 👍👍👍👍👍
Girls in thumbnail and examples with girlfriends always does the work for boys.....🤣🤣🤣🤣🤣🤣🤣.
BTW great work didi....lots of love and respect for ya.
jindagi k maze to rahul le rha h... hm to bs coding sikhte hi rah jaenge🥲
for those who are using Microsoft Visual and getting input array size error. you have to initiate dynamic array instead of static array.
#include
#include
using namespace std;
int main()
{
int n;
cout > n;
int *arr{ new int[n] };
for (int i=0; i < n; i++)
{
cin >> arr[i];
}
for (int i=0; i < n; i++)
{
cout
visual studio code se acha online compiler use krlo. itna janjhat he isme
thanq bro i was getting the same error
@@thewhitene9746 chup be chuu
@@thewhitene9746 apni dream company me jaa kar bhi online compiler use kario
@@thewhitene9746 Vs code is not a compiler and you can create your own user snippets using json for different programming language
she expains beautifully , i cant stop watching her video
Today I got to understand what really ARRAY is??? Thankyou APNA COLLEGE.
Aap hi sab video kijiye aapki aawaz dimaag ke saath saath dil ma bhi utar jaati ha ♥️
I'm the first viewer💪🏻🔥... Bhaiya aapne aag lga rkhi hai...!!🔥 And thanks di aap bhott acha explain karte hoo🔥🔥💪🏻 thank you so much other team members 💪🏻🔥❤️
maine to video's aage karke dekhe kaha aane vali hai didi...finally aa gayi ,sukun mila
"...aur usme daal do uske.. age !!"😂
(0.10 to 0.13 sec)
BTW Thank you so much for this type of consistency. Carry on. ❤
ruclips.net/channel/UCbFwBZLhHZEhhXy0nNCKlKg
Bahot tezz ho rhe ho 😜😜
@@sachinrastogi4691 nice share 🙃
Bade ha** mi ho beta😂
ruclips.net/video/5FsIa4Mp3ho/видео.html🙏🏻🙏🏻
result :: after preparing c++ from this series You may become rahul
I wish
kuch ni banega tu
😂
I become Neha's fan
ruclips.net/video/5FsIa4Mp3ho/видео.html🙏🏻🙏🏻
Thank you for this amazing series. I am from Electrical background interested in CS/IT and this playlist helped me a lot
EEE OR EE
From which college. I am also an electrical engineering student
Your teaching style is best plus your voice
Thank you Apna college team... for such a great work... 😊😊❤️
best teacher for c++,please jaldi se video daliyo
thanks a lot for this quality of course .
god bless you and all the team.
great work Aman Dhattarwal .after all he is paying the faculty from his own pocket.......imparting free education to all
Thank u bhaia and mam ur explanation is of next level with best example it make easy to understand 😃❤🖤
Thank You So Much Apna College for this amazing lecture 😊
Thank you so much Dii❤️ Ur way of explaintion is really great ❤️
Love ❤️day ☀️ assi 8️⃣0️⃣ hazaa 💸💸ke🙈🤘🏻shoes 👟👟🔥hai😘💔asssi✌🏻hazaar💲🤑💰ke😥🤲🏻teraa😭👀ghar🏠🏡jaayenga🤣😹ismee😜🏃🏻♀️tera 👈🏻ghar😙😂isme😜🤣chale🏃🏻♀️🤙🏻jaayennga😡👌🏻👈🏻poora🤯🙌🏻shoesss👟👟dekhh👀🤲🏻
YOU INDIAN GUYS ARE MUCH MORE BETTER THEN MY UNI TEACHERS
We appreciate your efforts, thanks u so much
Maaza aa gya.
Dumdaar khiladi meh Array ka definition yaad aa gya😂😂.
Rahul is so lucky.
He have too many girlfriends.
Neha didn't came in this video otherwise she come in every video.
Didi try to take Neha in next video.
Just joking ok.
Lol
Has*
@@_rahulsain rahul spotted
Oh bhai maro muje maro
very helpful videom thank u for the hard work for us, which is helping me and lakhs of students. very fortunate to recieve videos for no price. i would like to contribute back to apna college
Nice ma'am 😊😊 very useful videos
I think we should never ask age from girls 😂😂😂
Best comment
Right,Yes🤣🤣
thats why its an array because they never tell actual age to anyone .
🤣🤣🤣🤣😁😁😁
ruclips.net/video/5FsIa4Mp3ho/видео.html🙏🏻🙏🏻🙏🏻
Damn...!!!!! This Rahul fella is some real thing...
thanks a lot
as compared to two bhaiya in previous 2 videos you're far better then those bhaiya and explain the concept very easily
they may be good programmers but teaching to others is a different thing and i think you're pretty good on it.
😅
didi best ... GOAT .. good of all time teacher
Ye rahul ko milna hai muze ek bar zindagi me😂
Aur ye baki gfs ka bhi btana padega neha ko😂😂
@Rahul Sharma 😂 mil jaegi bhai
the two of the teachers before this video ohhh my god they are annoying thank god you came back...
Consistency 🔥🔥🔥🔥
Practice Question 2 : kid with the greatest no. of candies........(assuming the kid numbering starts from 1)
#include
using namespace std;
//kid with max number of candies
int maxcandy(int demoarray[], int n){
int maxi=demoarray[0];
for(int i=0; i
finally did is back........................
i like the way of teaching of didi, just i feel like my real didi is teaching me
Simp
ruclips.net/video/5FsIa4Mp3ho/видео.html🙏🏻🙏🏻🙏🏻
Thanks Bhaiya... and Please upload the notes of Time Complexity
We can give maxno=array[0] and minno=array[0] ans then
For(int i=1, i
I would love to volunteer to make captions for these great videos jo pan India ke liye helpful hoga so please switch it on
Bhot pyara pdhate ho yaar aaap
the explanations seem a little rushed, Like the reasons for doing certain steps are not explained clearly which makes it hard for beginners like me to understand. other than that I Love this series, it has helped me so much!!! thank you!
Upto which video should i watch if my motive is to learn only the essentials of ds algo...not competitive Programing??..
@@basabsaha6370 cp ke lectures to abhi upload hi nahi hue and mujhe nahi lagta ki aage kabhi upload honge
I like the way you teach us.
please explain i cant understand why we have taken maxNo=INT_MIN
and minNo=INT_MAX
when we take maxNo=INT_MIN, we are assigning the variable maxNo with the lowest possible value in c++. So now, any value from the array will be greater than this value, and will simply get assigned first. So maxNo will never be equal to INT_MIN. And for each element in the array, we are going to check if it is greater than the current maxNO value or not, and if it is, maxNo then gets updated.
@@sharansasikumar5127 bhai he's talking about the logic behind assigning int Minno=INT_MAX.
bhai intialise both of em with zero. and age jaake toh seekh hi jayenge insa b ke logic
Bro the logic behind it is..
int maxNo = INT_MIN
int minNo = INT_MAX
You know na, there is a inbuilt function max and min.
so maxNo = max(arr[i],maxNo) . Here arr[i] should be greatest.
and in int maxNo ,the number to be stored should be the smallest .
So int_min is stored in maxNo because its the min .
So if we compare max(arr[i],maxNo), here maxNo is smaller than arr[i]..
and max function finds the greatest number bewteen this.
arr[i] > maxNO;
So arr[i] is printed in max ..
Similarly reverse it in min function. You will get the answer.
Just sit for 2mins and think it logically.
hope it is useful.
@@Biliphang088 bhai tera 2nd para dekh wo bas if statement ko khatam karne ke lie h to uska isse koi logic nahi h.
#important for all
Sunna dd ne kya bola h, int_min aur int_max ke bare me (jab wo if statement likhi thi) maximum pane ke lie agar int_min agar kisi se choto hoga to wah update hoga(read again) mtlb wo aage badh jaega or aage chek karega min se max jane ke lie usi tarah iska ulta dekh sab samjh me aajaega
Moj krdi Rahul bhaiya aapne to😂😂
*Answer* of practice question 2 i.e. GIVEN IN THE NOTES
#include
using namespace std;
int main() {
int kids,i, maximum=0;
coutkids;
string NameOfKids[kids];
int CandyOfKids[kids];
cout
Where is the Problem statement?
YRVI MAAM IS BACK .....NOW IT WILL BE FUN
9:48
Instead of assigning INT_MIN to maxNo and INT_MAX to minNo, We should assign arr[0] to both of them as we are comparing the elements of array only
I can't understand the logic of Int min and Max can u please explain in English
Mene dono logic se bana liya😅😅
Finally urvi di is back
In love with girls voice ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️
Bhia ek suggestions in video ke sath thode questions bhi add kar dia karo video discription mei practice karne ke liye👍
0:16 Rahul is very lucky😁😁😁😁😁😁😁
Playboy h saala🤣🤣
Aman bhaiya bohot bigaad gye hai
Aur baccho ko bhi bigaad rhe hai
lode par hai
thank you bhaiya and didi(speaker).
much much love to both of you.
Rahul name is wrong , it should be ranbir Kapoor😂😂😅😅
WOW!THANKS FOR COMING BACK DI.
Waise explanation in the last video by BHAIYA was awesome.
BUT, YOUR WAY OF EXPLAINING IS LOVE...
Efforts appreciated ❤❤
I am falling in love with your lovely voice
And it's going to become my enthusiasm to learn c++
Didi ur explaination level is great
thanks that u come again in this playlist
thank you mam .you are good teacher for guide c++...
Yes 💟🥰🤣😆😂🥰🤣🥰💟
Isn't array memory allocated at compile time? How's your array getting created based on user input?
well you got a point
@@mumairnoor2398 Its dynamic allocation
Generally when we do not know what *will* be the size of array we use dynamic allocation
@@shreyashjoshi8489 well i fid almost the same
but when runing the code it just kept on stop working as my code was crashed
Superb Explanation...Thanks Maam
After this, I think Rahul is the reason why most of us are Single 😂😒
pdhai pr dhyan de tu
@@CleanDevelopYee jo tu kar raha haina usko timepass bolte hai tu jaake kar padhai
Love to see you you again...awesome explaination
When U R Rahul , & U R SINGLE 🥺🥺🥺🥺
WATCHING THIS VIDEO WILL BE A TRAUMA FOR U
🥺🥺😂😂
Really bro..😥😥
😔
Didi amazing course ❤❤😊😊
Rahul Be like My name is Rahul.....aka Womanizer 🤣🤦♀️
Apny both acha samjya ❤
Nice video !! But the practice questions given in the notes are not clickable. So, please look into that.
Okay
Yes you are right
@@ApnaCollegeOfficial now also I am unable to access the questions
Link of given questions is not accessible till now plz once check it @Apna college
Yaa! Just Google the lines given in the PDF in blue colour. You'll get the questions of LEET Code.
I'm from AHSEC board
Book : computer science and application by Dr. Diganta Das
Q. Can I use other header file as the climits header file wasn't use in there and in practical they use turbo c++..? recommed me alternative header file please !!
Isn't that a bad practice to initialize Static Arrays with a variable(like 'n' in this case) because Static arrays have to be initialized with a Constant Value? Clang and MingW may allow u to do that but if you try to do this on Microsoft Visual C++ that will throw a Compilation Error and Program Crashes.
The Error is stated as:
*expression must have a constant value -- the value of variable "n" (declared at line 5) cannot be used as a constantC/C++(28)*
Lmfao,I'm getting the same issue
Dynamic Arrays is solution to initialize an Array with the Size that user inputs.
@@shahnoorraza8514 yep
@@shahnoorraza8514 Thanks bro
@@adityab1277 Welcome
Thnk God didi is come back 😘😘
Rahul : Naam to suna hoga he he he😂
Good example. It best suits to one of my friend.
so in the practice question 2 , do we need to find the max number of candies among the entered candies or the kid with the max candies
i think they are talking about the kid with the max number of candies.......anyway do them both.......
//RUNNING SUM OF AN ARRAY
#include
using namespace std;
int main()
{
int n;
coutn;
coutnums[i];
}
cout
6:28 Fir Arnub chacha bolenge mujhe drugs de 🌚🦆
#include
using namespace std;
int main (){
int a ;
int sun = 0;
cin >> a;
int array[a];
for(int i = 0; i < a ; i++){
cin >> array[i] ;
}
for(int n = 0; n < a ; n++){
sun += array[n];
}
cout
// we can initialize min and max with the first element and start the loop from 1 (current me if I am wrong here, thanks in advance)
private static void mainAndMaxInArray(int[] arr) {
int min = arr[0], max = arr[0];
for (int i = 1; i < arr.length; i++) {
if (min > arr[i]) {
min = arr[i];
}else if(max < arr[i]){
max = arr[i];
}
}
System.out.println(max +"::::"+ min);
}
Thank you.
edit : bas ek chota sa doubt tha.....maine jab C programming mai array declare karna seekha tha to usme hame pehle hi array size batani padti thi, so is this a new feature that C++ has in which we can get the size of the array from the user during runtime without using malloc and stuff?
no you can use that in C language also
Bhot tagda content hai bhaiya ji 🙏🎉🔥
URVI didi ❤️❤️🔥🔥
Congratulations for 1M
0:17 RAHUL THE PLAYBOY 😂😂
Thank you so much AMAN BHAIYA and the whole team of APNA COLLEGE ❤️❤️✨✨
Rahul ke girlfriends 🤣🤣🤣🤣
Mam your voice is so sweet ❤️
Perfectly explained
*Answer* of practice question 1 i.e. GIVEN IN THE NOTES
#include
using namespace std;
int main() {
int n;
coutn;
cout
Awesome lecture!!
The practice questions link isn't opening. please see.
And also in the notes, lec 7.1 is titled as 8.1 and now 8.1 is titled as 9.1
thanks again @Apna College
Yeh lecture mai puri feel aa gyi 💯⚡
The reason most of us are single: Rahul xD
▶️▶️▶️ There is no course like this one on RUclips. ▶️▶️▶️
Thumbnail mai Aman bhaiya 3 girls ko aankh maar rahe hai😁😁
Aare bhai Rahul tum to bade heavy driver nikle yaar 😂😂😂
MY APROACH FOR MIN MAX PROBLEM:
int main(){
int n, min, max;
cout> n;
int ages[n];
for (int i = 0; i < n; i++){
cin>> ages[i];
}
min = ages[0];
max = ages[0];
for (int i = 1; i < n; i++){
if(max < ages[i]){
max = ages[i];
}
else{
if (min > ages[i]){
min = ages[i];
}
}
}
cout
you could've made a function for finding the max and the min value
🥰
well there is already min() and max () function so that's also not needed.