So we are going in the university just to mark attendance and pay the fee and getting education for free here. Thank you so much. lots of love from #NEPAL
You're an savior honestly. I don't live in India and my hindi isn't the best but you still manage to do an amazing job. Thanks for making videos like this.
sir today i saw your lecture about fork and then after i solved a question of fork which is asked in 2019 .it was so simple that it took only few seconds .before that i was unable to solve this question.thank you sir for your amazing explanation.
🎯 Key Takeaways for quick navigation: 00:01 📚 Introduction to Fork System Call 02:03 🔄 Return Values of Fork System Call 03:34 🖨️ Demonstration of Fork with One Call 05:31 🌳 Multiple Fork Calls and Process Generation 08:08 📊 Summary and Key Takeaways Made with HARPA AI
Gate smashers bhai sabse accha teacher hain class ka DBMS kuch samajh mein ata hi nhi tha aapke video dekh ne ke baad dbms ka concept pura samajh mein aya aisha padhate raho sir love you ❤❤❤ ❤
In the parent process, the value of pid after calling fork() will be the process ID (PID) of the newly created child process. The pid variable will contain the PID of the child process, allowing the parent process to identify and potentially interact with the child process using this PID.
This video is really really great sir. You are doing great work for us. It will be a great help if you start a series on Artificial Intelligence and software engg according to UGC NET new syllabus. I think many people will be grateful to you. Thank you in advance sir.
👏 HatsOff to you sirji ....4 years Ki Study me ye topic nahi samja but today I understand it very well...kash aap pehle milte... You are the Best teacher
First answer is 30 because fork() loop m h toh 4 times loop chl rha h toh uske according jitne child process hoge uthe hi baar print hoga toh 30 times “1” print hoga Or second m 2 times print hoga
now a days getting college degree is just a fun but getting knowledge from such teacher is fruitful 😛 keep going sir students like me need more content 😅😅
16 times 1 will be printed because the formula mentioned by sir is 2^n for how much time the program is executed . (2-1) ^ n for how many child processes created Watch the video to get full easy and easy explanation Thank you sir
@Sajib Saha But if fork() methods in if block returns +ve value it means they have created a child process, then there are 3 fork() statements executed, So what will be the answer now?
The answer would be 4, because fork() method return return both 0 and 1,one after another, then there will be 4 cases in if block 00, 01, 10, 11. In 2nd and 3rd condition fork() method creates a child process and execute printf statement one after one. And in last case when fork() methods will return 1, then the inner fork() method will create a child process and a parent process. Thus, 4 times printf statement will be executed.
@Sajib Saha But what about fork() in if block, as condition of if block is also a fork() method, whether the condition satisfies or not, fork() in condition parentheses will be executed, I am not talking about fork() just after if block, I am talking about fork() in the condition of if block
fork() function is executing 4 times so total 2 to power 4= 16 process will create including main process all 16 process will execute printf("1") so 1 will print 16 times in output Ans (B) 16
2 times "hello" will be printed in 2nd question bcz in case of "and" if 1st returns 0 then second case is not checked then only one fork call is made and in the result 2 times it will be printed.
sir... 50k hone wala h SUBSCRIBERS. .....haha SILVER play button ke sath new chapter of UGC-NET ka start kar dena bcoz exam ki DATESHEET aa gaye h..PLZZZZZZZZZZZZZZ
🎯 Key points for quick navigation: 00:01 *🛠️ Introduction to Fork System Call* - Explanation of the fork system call for creating a child process. - Use of fork in the C programming context, creating a clone of the parent process. - Differences between creating a new process with fork and using threads. 02:03 *📜 Fork System Call Behavior and Return Values* - When a fork is invoked, it returns a value that indicates the process context (child, parent, or error). - Child process identified by zero, parent by a positive number. - Discussion on scenarios leading to failure (-1) and expected outcomes. 03:05 *🔄 Fork Execution Sequence* - Description of how multiple fork calls impact process executions. - Forking leads to multiple parallel "Hello" print outputs. - Example illustrating fork mechanism with two forks resulting in multiple processes. 06:02 *➗ Process Count with Multiple Forks* - Calculation of the total number of process prints and child processes. - Formula: 2^n total processes and 2^n - 1 child processes per n fork calls. - Emphasis on understanding "Hello" print count and process hierarchy. Made with HARPA AI
Sir whatever you said was alright and you explained everything well but kindly tell us that what is practical importance of this call and when to use this . What will be the advantage of creating a child process ? In actual practise i dont think we will be required to do same thing n number of times. Thank you .
In the starting part of the video you mentioned that child process is created when the parent is busy or not available to execute the process but in the latter part of the video you were teaching that both the child and parent process work simultaneously, then what is the need for creating child process?
16 and 2 is the answer of the last two questions 16:- loops execute 4 times so 2^4 so ans is 16 2:- fork returns 0 or +ve value if there is no instruction then it return parent and parent means +ve so +ve and +ve means +ve and one time fork written there so so 2^1 so ans is 2
Our education system needs more teachers like him!
exacly ..he teaches uh without any boredom .
Yes bro.
yes specially professors
Ok then Go ahead
Strongly agree !
So we are going in the university just to mark attendance and pay the fee and getting education for free here. Thank you so much. lots of love from #NEPAL
Make Fork Tree and count the total number of nodes at last level! OR for 4 times a, it will be 2^4=16 times (15 Child Processes, 1 Parent Process).
1) B
As n=a and a=4. so 2^4=16
2) A
if condition is satisfied and fork is one time. n=1. Therefore 2
ONE OF THE BEST TEACHER OUT THERE ❤️ ,VERY HONESTLY SPEAKING ,I DON'T USUALLY COMMENT ON A TH-cam VIDEO BUT SIR YOU TEACHES WITH SUCH EASE❤️❤️❤️❤️❤️❤️
English sudhaar amit you teaches nhi likhte gdhe
@@Shubham-ui5yy chill bro😂🙌
You're an savior honestly. I don't live in India and my hindi isn't the best but you still manage to do an amazing job. Thanks for making videos like this.
9:53
child processes - 15
It will print 16 times
can you explain pls
@@khushal3418 with the formula....
2^4 -1 children and 1 parent
4 because loop runs 4 times
correct
hyy what is the ans for the 2nd question, i see no one has commented it?
@@yujibestboiit should be 2
Best Explanations of fork() system call and numerical explanation.
For parent (ye to hoga hi) This line of yours reminds me the whole method of fork(). Thank you sir g.
sir today i saw your lecture about fork and then after i solved a question of fork which is asked in 2019 .it was so simple that it took only few seconds .before that i was unable to solve this question.thank you sir for your amazing explanation.
What is the answer of 2nd question. Can you help me?
4@@manishbadgotra
@@67_rohitraj54 thankyou for helping
Because of this type of teachers, I get inspiration to continue higher studies
Really, Our Education system needs teacher like you...I Salute you Sir👏👏👏
Sir Ur Way Of teaching is amazing ....May God bless u ....
Farishta hai ye bnda...
He has got countless number of blessings...
Live long sir ❤️🌹🧿
Thank You.. Thank You Sir! You accepted my request on videos for Fork() system call. I am so grateful to you.
Sir u teach every topic with great enthusiasm. 👍👍👍👏👏
For my dear friends, who is searching answer for 2nd question, there is a detailed explanation of this question in the next video of this playlist.
thanks bro :)
thenkss
tnx
ohh thanks bro ive been trying so hard
thanks bro
Best education on youtube. With your education we can understand everything.
🎯 Key Takeaways for quick navigation:
00:01 📚 Introduction to Fork System Call
02:03 🔄 Return Values of Fork System Call
03:34 🖨️ Demonstration of Fork with One Call
05:31 🌳 Multiple Fork Calls and Process Generation
08:08 📊 Summary and Key Takeaways
Made with HARPA AI
Great teacher. Salute you from pakistan
4 times loop run so 4 times fork command executed and result comes out to be 16 option(b)
Wrong
@@yash.gupta_ so what's the answer man
@@subscribeinsteadlike2768 30
@@voidofficial6525 you are wrong answer is 16 bro
@@prathamgupta6973 ANSWER IS 16 AS THE FOR LOOP WILL RUN 4 TIME FROM 1 TO 4 SO 4 TIMES AND 2^4 =16 SHOULD BE THE ANSWER.
I think no one can forget the output of fork after such explanation.. Thanks a lot sir...
Awesome.. Thank u sir. How could someone dislike such a wonderful session.. Really u r amazing
It's very important lecture for me thanku so much sir bht hi acha explain Kiya apne
it will print "hello" 4 times.
p
/ \
(Fork()=0) c1 p(fork()=1)
/ \
c2 p
/ \
c3 p
:- c1+c2+c3+p = 4 times "hello"
Is this right?
YES
Gate smashers bhai sabse accha teacher hain class ka DBMS kuch samajh mein ata hi nhi tha aapke video dekh ne ke baad dbms ka concept pura samajh mein aya aisha padhate raho sir love you ❤❤❤ ❤
In the parent process, the value of pid after calling fork() will be the process ID (PID) of the newly created child process. The pid variable will contain the PID of the child process, allowing the parent process to identify and potentially interact with the child process using this PID.
example de kr aap ne samjhaya , uske liye bahut bahut Thank you sir. Ab nahi bhulungi
a goes from 1 to 4, so Total 4 times fork is called so "1" is printed 2^(4) = 16 times. There will be 15 child process and 1 parent process
right
Wrong
sir gajab padhate hai ....
every topic crystal clear 😍
well explained Sir... We need teachers like you in out university that we are lacking now
mein to sir ke teaching ka fan bante ja raha hun ....love from bottom of my heart
Answer (B) 16..
Tnx for clear explanation sir..thank u so much...😊😊
AOA guys I am from Pakistan, he is one of the best and my favorite teacher,,.
This video is really really great sir. You are doing great work for us. It will be a great help if you start a series on Artificial Intelligence and software engg according to UGC NET new syllabus. I think many people will be grateful to you. Thank you in advance sir.
Very good explanation sir.
Forking amazing 🔥
Sir I am the biggest fan of u. Sir I am a bca student.and I learn every course u provide like CN,OS,DBMS,
Thank you sir for this part.... I was waiting for this...
most respect from Pakistan
Syed tehzeeb Haider
MashAllah
Saandaar, jaandaar,Jabardast,jindabaad... gurudev ki jay.
Answer for the question at last is 2⁴=16 option B as loop rotates 4 times .
Informative Video🙏🙏
Thank you very much sir. Lots of respect to you.
My concepts got clear by watching your video.
Searched everywhere to understand but couldn't.
Tysm.#
आपका बहुत बहुत आभार प्रकट करता हूं धन्यवाद 🙏
cant thank you enough... Have been struggling for this since two days. I could understand this perfectly. Thank you so much
@Vasudha Pasumarthi can you tell from where are you preparing for DEC?
One of the best teacher in india 🇮🇳
Keep up the good work Sir👌thank u
👏 HatsOff to you sirji ....4 years Ki Study me ye topic nahi samja but today I understand it very well...kash aap pehle milte... You are the Best teacher
Q1 : 16 times Print 1
Q2 : 4 Times Print Hello
Can you please explain Q2's answer
Pls explain Q2... I beg 😭😭😭😭😭😭😭😭😭😭😭😭
@@Arceus948 @Mrudula Rothe P -> {C1, P} -> {C2, C1, C3, P} Therfore, 1 Parent & 3 Child, So 4 Times "Hello" Will be Printed.
@@BhagyaRana ok thnx 😀👍🏻
My PHD teacher's didn't give a fuck to make students learn C language.
But you sir 🔥🔥🔥🔥🔥🔥🔥🔥
B-16 times "1" is printed
First answer is 30 because fork() loop m h toh 4 times loop chl rha h toh uske according jitne child process hoge uthe hi baar print hoga toh
30 times “1” print hoga
Or second m 2 times print hoga
Answer 31 hoga!!!!!
1. 16 correct
2. 2 is correct
Thank you so much sir for provide such kind of contents 😊😊
1 is correct but i doubt the second one. some are saying 4 is the answer of 2nd question
I think it will 2
Kash college ke teachers bhi aise hi padhate 😊
now a days getting college degree is just a fun but getting knowledge from such teacher is fruitful 😛
keep going sir
students like me need more content 😅😅
best engineering channel on youtube.great sir g
sir obviously 16 becasuse of 2^4 here n=5 -1=4 from loop, 15= child and 1= parent
good explanation :)
Wow! U have explained the concept in such an amazing manner. Thank you 😊
Your pedagogy is superb .
Tumne inki pedagogi kb dekhi bhn...shrm nhi ayi unki pedagogy Dekhte hue..👀🙊🙈
ques 1: B
ques 2: A
Your teaching is awesome sir 👌👌
16 times 1 will be printed because the formula mentioned by sir is 2^n for how much time the program is executed .
(2-1) ^ n for how many child processes created
Watch the video to get full easy and easy explanation
Thank you sir
He and Code_with_Harry are my best youtube teachers.
16 times "1" will be printed (15 child nodes and 1 main node)
5 saal ke baad bhi apki playlist neya jesa lag raha hai 🤩🤩🤩🤩
Answer of question 1 asked in the end will be "option B" i.e. "16" (2^4 because loop will be executed 4 times)
Your style of teaching is excellent. Superb👍
16 and 4? Whatever be the answer, you're an awesome teacher! I'm a high-schooler and even I could understand this!
sahi ha bhai
pls explain ans of 2nd ques
@Sajib Saha But if fork() methods in if block returns +ve value it means they have created a child process, then there are 3 fork() statements executed, So what will be the answer now?
The answer would be 4, because fork() method return return both 0 and 1,one after another, then there will be 4 cases in if block 00, 01, 10, 11. In 2nd and 3rd condition fork() method creates a child process and execute printf statement one after one. And in last case when fork() methods will return 1, then the inner fork() method will create a child process and a parent process. Thus, 4 times printf statement will be executed.
@Sajib Saha But what about fork() in if block, as condition of if block is also a fork() method, whether the condition satisfies or not, fork() in condition parentheses will be executed, I am not talking about fork() just after if block, I am talking about fork() in the condition of if block
Nice sir aap Awesome hooo❤❤❤❤❤❤❤
fork() function is executing 4 times so total 2 to power 4= 16 process will create including main process
all 16 process will execute printf("1")
so 1 will print 16 times in output
Ans (B) 16
32. dwar diagram n will understand
masha ALLAH well sir topic ap ny esy smjaya jesy mahkan hota hai
16 times "1" will be print in output and 4 times "hello" will be print
4 time hello kyu print hoga bhai..jb output me sirf 1 ko print karwana hai too..ek baar code ko run ke dekho
2 times "hello" will be printed in 2nd question bcz in case of "and" if 1st returns 0 then second case is not checked then only one fork call is made and in the result 2 times it will be printed.
Besttt🎉🎉🎉🎉
sir... 50k hone wala h SUBSCRIBERS. .....haha SILVER play button ke sath new chapter of UGC-NET ka start kar dena bcoz exam ki DATESHEET aa gaye h..PLZZZZZZZZZZZZZZ
🎯 Key points for quick navigation:
00:01 *🛠️ Introduction to Fork System Call*
- Explanation of the fork system call for creating a child process.
- Use of fork in the C programming context, creating a clone of the parent process.
- Differences between creating a new process with fork and using threads.
02:03 *📜 Fork System Call Behavior and Return Values*
- When a fork is invoked, it returns a value that indicates the process context (child, parent, or error).
- Child process identified by zero, parent by a positive number.
- Discussion on scenarios leading to failure (-1) and expected outcomes.
03:05 *🔄 Fork Execution Sequence*
- Description of how multiple fork calls impact process executions.
- Forking leads to multiple parallel "Hello" print outputs.
- Example illustrating fork mechanism with two forks resulting in multiple processes.
06:02 *➗ Process Count with Multiple Forks*
- Calculation of the total number of process prints and child processes.
- Formula: 2^n total processes and 2^n - 1 child processes per n fork calls.
- Emphasis on understanding "Hello" print count and process hierarchy.
Made with HARPA AI
Sir whatever you said was alright and you explained everything well but kindly tell us that what is practical importance of this call and when to use this . What will be the advantage of creating a child process ? In actual practise i dont think we will be required to do same thing n number of times. Thank you .
thank you for adding english subtitles. great explanation
Please make a video that how os interact with processor...
sir your teaching method is very good
sir plz NET k liye b subjct wise videos provide kr dijiye according to the schedule u provided...
Best teacher ❤️ ♥️ 💙 💖
sir, the endscreens at the end are covering the mcq's
Pause the video at 9:58 you will get slight transparent screen
@@aabid3375
Thanks
Sir u are the world 's best teacher.
sir, does it make a difference if we write
main()
{
fork();
printf("HELLO");
fork();
}
it will not work, and will give output of (Hello Hello)
Thank you Sir
Lots of love and Thnx from Pakistan❤️🇵🇰
I recommend your channel to my Fellows
answer the video question
Q1 -option(B) 16
Q2 -option(C) 4
please explain Question.1> how it is 16?
Sir i have back in os
And after learning from ur lectrs i thnk my back will get clr in sha allah
Sir
Your way of teaching is awesome
I wish you to God fill your all desire
Sir can please provide me viedoes ipc mechanism
Thank you so much..lots of love and blessings
Thank you Sir.
I have been watching this video On the day of exam.
Q1) option B and Q2) option C. please correct me if i am wrong
2 ka C kesy ana..please guide me..😑
Watching this 5 days before Gate 2023....Thank you Sir!! Great explanation 🙏
pass hui ke nahi?
Amazing explanation!! Maybe you could have mapped the fork to tree data structure and explained why it is 2^n.
Very useful vedio sir 🙏🙏👍👍
In the starting part of the video you mentioned that child process is created when the parent is busy or not available to execute the process but in the latter part of the video you were teaching that both the child and parent process work simultaneously, then what is the need for creating child process?
did you get the answer?
very good explanation
16 and 2 is the answer of the last two questions
16:- loops execute 4 times so 2^4 so ans is 16
2:- fork returns 0 or +ve value if there is no instruction then it return parent and parent means +ve so +ve and +ve means +ve and one time fork written there so so 2^1 so ans is 2
i think 4 is answer
for part 2
for part 1 -> 32 is answer
You teach things in a pragmatic way. Love from Pakistan