Loops in One Shot | C Programming | Lecture 3 | Complete C Course
Vložit
- čas přidán 5. 08. 2024
- In this video, Raghav Sir will teach you LOOPS in DETAIL. This is Lecture 3 of the C Programming series. Topics covered are - For Loop, While Loop, Do While Loop and LOTS of QUESTIONS. Pattern Printing will be covered in the next Lecture in detail, coming SOON.
Notes of this lecture - drive.google.com/drive/folder...
If you are joining us late, to know more about PWSkills & plans :
Watch the Orientation Video: • C++ DSA and Java DSA -...
Watch the Launch Video: • @CollegeWallahbyPW THI...
▶️ PW Skills Website - pwskills.com
▶️ PW Skills Instagram - / pwcollegewallah
▶️ PW Skills LinkedIn Channel -
▶️ PW Skills Telegram Channel- t.me/SkillsPW
Timestamps :
00:00 Introduction
01:35 What and Why
05:53 FOR LOOP
09:50 How For Loop works
30:15 Problem 1 : Print all numbers from 1 to 100
34:56 Problem 2 : Print all even numbers from 1 to 100
37:36 Homework 1 : Print all odd numbers from 1 to 100
37:50 Problem 3 : Print the table of 19
40:07 Homework 2 : Print the table of ‘n’. Take ‘n’ input from user
40:42 Problem 4 : Print the AP - 1,3,5,7,9.. upto ‘n’ terms
47:13 Problem 5 : Print the AP - 4,7,10,13.. upto ‘n’ terms
50:34 **Printing AP WITHOUT using MATHEMATICAL FORMULA
58:28 Problem 6 : Print the GP - 1,2,4,8,16.. upto ‘n’ terms
1:00:55 Homework 3 : Print the GP - 3,12,48.. upto ‘n’ terms
1:01:16 **Problem 7 : Print the AP - 100,97,94.. upto all terms which are positive
1:10:48 Homework 4 : Print the GP - 100,50,25.. upto ‘n’ terms
1:12:42 BREAK statement
1:13:07 Problem 8 : Program to find out if given number is prime or not
1:38:16 CONTINUE statement
1:38:28 Problem 9 : Print all odd numbers from 1 to 100 using CONTINUE
1:43:41 Homework 5 : Print all even numbers from 1 to 100 using CONTINUE
1:44:15 WHILE LOOP
1:49:47 INFINITE LOOP
1:53:11 Problem 10 : Predict the output 1
1:56:34 Problem 11 : Predict the output 2
1:57:33 Problem 12 : Predict the output 3
1:58:58 Problem 13 : Predict the output 4
1:59:34 Post / Pre - Increment / Decrement operators
2:05:03 Problem 14 : Predict the output 5
2:07:31 Problem 15 : Predict the output 6
2:10:38 Problem 16 : Predict the output 7
2:12:44 Problem 17 : Predict the output 8
2:13:56 Problem 18 : Predict the output 9
2:15:55 Homework 6 : Predict the output 10
2:16:29 DO WHILE LOOP
2:21:25 Questions using Operators
2:21:53 Problem 19 : Program to count digits of a given number
2:31:20 Problem 20 : Program to print sum of digits of a given number
2:39:26 Homework 7 : Program to print sum of even digits of a given number
2:40:22 Problem 21 : Program to print reverse of a given number
2:53:27 Homework 8 : Program to print sum of given number and its reverse
2:54:04 Problem 22 : Print sum of series - 1+2-3+4-5+6.. upto ‘n’ terms
3:07:40 Problem 23 : Print the factorial of given number
3:16:09 Homework 9 : Print the factorials of first ‘n’ numbers
3:21:43 Problem 25 : Print the nth fibonacci number
3:38:36 Homework 10 : Print the first ‘n’ fibonacci numbers
3:39:39 Problem 26 : Given 2 numbers ‘a’ and ‘b’ , find ‘a’ raised to the power ‘b’.
3:48:09 Problem 27 : Print all alphabet and their corresponding ASCII values
3:55:31 Homework 11 : Print all armstrong numbers between 1 and 500
#CProgramming #CollegeWallah #PhysicsWallah #Loops #Loopsinoneshot
📗 Enroll Now in Decode Batches and become JOB READY:
📌 Python with DSA: bit.ly/4bXv5xF
📌 Java with DSA: bit.ly/49vEQkZ
📌 C++ with DSA: bit.ly/49NnNKT
The amount of happiness you get after a code finally runs🙂
😂😂😂 yeahh fr
Excellent 👌
Well done
fr💀
Is infinite 😊
40:42 Problem 4 : Print the AP - 1,3,5,7,9.. upto ‘n’ terms
50:34 **Printing AP WITHOUT using MATHEMATICAL FORMULA
1:01:16 **Problem 7 : Print the AP - 100,97,94.. upto all terms which are positive
1:13:07 Problem 8 : Program to find out if given number is prime or not
1:33:10
1:38:28 Problem 9 : Print all odd numbers from 1 to 100 using CONTINUE
1:49:47 INFINITE LOOP
2:03:50
2:12:44 Problem 17 : Predict the output 8
2:13:56 Problem 18 : Predict the output 9
2:21:53 Problem 19 : Program to count digits of a given number
2:31:20 Problem 20 : Program to print sum of digits of a given number
2:39:26 Homework 7 : Program to print sum of even digits of a given number
2:40:22 Problem 21 : Program to print reverse of a given number
2:53:27 Homework 8 : Program to print sum of given number and its reverse
2:54:04 Problem 22 : Print sum of series - 1+2-3+4-5+6.. upto ‘n’ terms
3:07:40 Problem 23 : Print the factorial of given number
3:16:09 Homework 9 : Print the factorials of first ‘n’ numbers
3:21:43 Problem 25 : Print the nth fibonacci number
3:38:36 Homework 10 : Print the first ‘n’ fibonacci numbers
3:39:39 Problem 26 : Given 2 numbers ‘a’ and ‘b’ , find ‘a’ raised to the power ‘b’.
3:48:09 Problem 27 : Print all alphabet and their corresponding ASCII values
3:55:31 Homework 11 : Print all armstrong numbers between 1 and 500
Itni mehnat kyu krta ho jab already commented hi toh😊
Gajab bru
Sir Excellent 👌 teaching 😊
kisi ne homework solve kiya hai? please kese hoga print table of n . aur odd number wala .
Comment out krde Bhai apna comment😂😂
who are from semester 1 student?
✋
🙋
Me....
class 10😮
Bhai 10th me focus kr
at 1:57:21 there was a semi colon just after the condition of while statement while(i
Yes you got that right even I was thinking the same.
Same here
Yes , you got it
I am thinking also
53:00 can someone explain the without using maths method?
Nhi samajh aaya
yes you are right
If you have a good mentor who can teach you in the most appropriate way then everything looks to much easy..❤
bhai 2:21:25 m sir ne ki bola manvi mam ne ek lecture karwaya hai operators ke upar.........bhai vo video ka link de sakte ho bhai merko mil nahi raha hai video vo wala
@@shubhamkumar3139Bhai i think sir janvi mam ki Java playlist ki baat kar rahe Hain..wait Karo main link send karta hoon😇
such a masterpiece this lecture was! sir you made each and every concept seem so easy.
Majaa aa gaya sir ji 😅
😅
I am student of IITJ and i have seen your video ,you provide very good content to the students to buid their career
thanks for providing good code.
happy coding!!
nice to meet you i am from IIT BHU
I am from home
After taking 2 years of gap
nice to meet you I am from IIT K
I am from vit Vellore
From VNIT Nagpur, are you people allowed a reference book in exam as here our clg is taking this subject very seriously they make such a paper that they even allow us to carry a book in the exam hall, I am just wondering what's happening in IIT
worth it lecture to watch for freshers and even for those who just want to clear their basics !!
Thank u sir...❤❤❤❤❤❤
Bhot bhot dhanyawad sir jii ❤️🥰👍
We can never forget the role of teachers like youuu in building our career....
Sir ka name kya hai
@@addictgamer-bn8jl raghav
sir mai aapke video starting se dekh raha hu or muje pahle c language nahi aati thi but aapke video starting se dekhney ke baad aab muje c language learn karney mai or usse question solve karney mai bahut acha lag raha hai thank you so much sir 😁😄😇♥♥
solution of hw at 2:53:00 is
int n;
printf("enter the number ");
scanf("%d",&n);
int a=n;
int r=0;
int x;
while(n!=0){
x=n%10;
r=r*10;
r=r+x;
n=n/10;
}
printf("the reverse of number is %d
",r);
printf("the sum of both is %d",r+a);
Thanks for giving answer .
Thanks for solution
Sir jaldi jaldi c language pura complete kara dijiye mid sem exam coming soon🥰❤️
We want Lecture 4 Sir...Maza Aa Gaya Sir is lecture me🙌❤️
1:11:53 for those having error in this problem👇🏻
Make sure you have use printf(a=a*(1.0/2));
The issue is due to integer division. In C, when you divide two integers, the result is also an integer, and any fractional part is truncated. So (1 / 2) results in 0 rather than 0.5. Consequently, a remains unchanged since it's multiplied by 0, resulting in an infinite loop of printing 100.
(Taught in Lecture 1 i guess🤔)
Sir mst explanation very very thanks 🙏🙏🙏 kaise khu etna acha content ko dekh ke
what a amazing lecture sir falling in love with coding now😍
Sir Jaldi Jaldi Video Laiye Aap C Language me itna interest Bana diye hai ki wait nhi ho raha and Exam bhi hai Jan me sir So please Complete This series as soon as possible...❤️✨
@@RohitSingh-jg3sw learn python,,
It's very easy language,,
Easily samaj aa jayegi 😊,,
&
Then DSA bhi python me kar sakte ho,,
Python & javascript is most popular language now
@@jayw698 but he's saying that he's in 1st year.....So what will he do in exam....Maybe C Language is 1st year syllabus
@@samislost550 exam ke liye pyqs dekho ,,,
Jitni c language important hai utna karke nipta do,,
C is important just for college exam,,
You should not give much importance to college exam,, college ka syllabus prepare karne se placement nahi hoga
One more suggestion-
C language me tumhe coding continue nahi karni chahiye,,, iske baad c++ pe switch kar jao
Reason - c++ is object oriented programming & c++ has STL library which will make data structures easy
C & c++ are 80% same hai,, so switching from c to c++ is easy,,,
Yeah one more thing c language me dikkat ho rahi hai to python kar sakte ho ,,
@@jayw698 Thank You So Much For Suggestions ❤️.....Gonna do it right now
Starting to learn C++ but continuing C also.......Waise bhi sir 10 din me upload karte hai c ka to cover ho jayega.....
@@samislost550 👍
Watched the whole lecture 🎉🎉🎉🎉 Long but up to point ❤❤
Thank you so much sir for this amazing lecture.🙂 This lecture is very helpful for students.
Thankyou ❤️ so much sir for this lecture bcz before this lecture i have many common doubt in loop but I watch this lecture all my doubt clear 😊😊
Sir please continue this series. your teaching style is outstanding.
Completely dependent on you for C programming. THANK YOU SIR.
I watched many videos on CZcams, but no one explained every topic so well, sir, you explained it very well, thank you very much. ❤❤
Really it is very nice to learn coding with you sir❤❤
This is a very informative lecture.
Thank you sir!
You have proved that pw's lectures are best 😊.
2024 batch attendance here....❤
Maza aa gaya sir... And you don't need to improve yourself sir... You are really a very good teacher... Loop pura acche se samjha diya apne
The amount of happiness you get after a code finally runs🙂okay
Sir is teaching very best, proper problem solving sum so you can practice a lot.
Thank you sir 🙏
Maza aa gaya 😊
Avi tak me ne pura lecture complete dekh liya 😊
Or saari chije samajh aa gayi .
Majaa aa gya sir, pura lecture smjh aa gya. Thank you very much!!
Alhumdulilah complete 😍😍
sir Your teaching skills is really incredable ,,, mujhe c program se dar lagta tha logic samaj main nahi ata tha then upka ye video mera sara problem solve kar diye loop ka thank you sir
Sir in 2nd question
predict the output for while loop..
Int I=1;
While(I
Sir PW is the best
Waiting for lecture -4👍👍
You are so intelligent and good teacher sir 😊
Thanku so much 🙏
Thank you sir this video help me a lot too learn very good explanation who even doesn't know any basics of c they can also understand easily ❤🙏🏻🙏🏻🥺
2:21:53 Problem 19 : Program to count digits of a given number--------there is problem.if n=0 then the num of digit is 1.
int n,count=0;
scanf("%d",&n);
if(n==0){
printf("the num of digit is: 1");
}
else {while(n>0){
n=n/10;
count++;
}
printf("the num of digit is :%d",count);
}
Best teacher for coding I have ever seen ♥️
Thankyou sir for giving this amazing lecture 😍😍
Thanks sirrr bhut sare doubts clear hua aapke pdane se👌👌
Sir you are all-rounder !😊
You can teach anything whether it's the maths or any other programming language!!
Really helpful!!
@gurukripakevalam195 Yeah! obviously!!👍
2:53:30 store value of n in any other variable ,for example a.
int a=n;
🙏
Thanks
Thanks bhai 🙂
Can you give us solution?
@@aryangupta6660 int n;
printf("enter the number ");
scanf("%d",&n);
int a=n;
int r=0;
int x;
while(n!=0){
x=n%10;
r=r*10;
r=r+x;
n=n/10;
}
printf("the reverse of number is %d
",r);
printf("the sum of both is %d",r+a);
Maza aa Gaya Sir ❤ Thank you for the amazing lecture
I have watched the whole video...Thank you so much sir....🙏
Hamlog jaisa kamjor students ke liye aap jaise teacher hi ek ummid ka Kiran hote h sir
Thank you so much sir ❤❤
Thank you sir for your efforts 💗
This is amazing tutorial video 👏👏👏
Thank you so much Sir for this amazing Lecture 💓
sir...Good work
keep Doing
in our society need teacher like you....
As a first year i feel that this is best and detail video on loop in the youtube and question are also good
maza aaya padh ke 😃
par beta ye padh ke exam mai marks nahi ayenge marks
@@SumitsinhChauhan-xi3dk kyu?
@@SumitsinhChauhan-xi3dk??
Amazing lecture guruji🙏🙏
Yah video bahut achha laga sir . Aur achhe se samajh me bhi aaya mujhe
Thankyou sir for this amazing lecture.
MAZA AA GAYA
Although I am learning Java from Manvi Ma'am...But this series is really very helpful for revision of concepts and practice of questions...Thank you so much sir for this series...
Semester 2 ✊
Thank you sir. this lecture took a lot of time to complete. As I am currently in my comfort zone at home. I took 5 days to complete this one lecture. But I will study more from now.
Thank you sir
You are amazing teacher
Sir aap aisa he video bnaye rheya hmara jaisa students ke leya ye bhut important hai
Thank you sir 🙇🙇
You understand the feelings of the student. Thank you so much sir 💖💖💯💯
Amazing sir, thanks 👍
Thank you sir, for upload deeply study videos for c programming ..🙂🙏
Sir kinti baar shukriya kahu aapko, itne saare acche questions.Ekdam se sab chamak gya. Maja aa gya lecture number 3 krke. Again THANK YOU SIR.
Who are from 2nd semester students
Me hu
Me
@@Nikhil-kg5fv you're in primary school 🎒😂😂
1:56:48 sir in this question there is semi colon in the end of line of while so the while loop will not run .
Then there will be no output
While loop is run infinite times
@nishantsingh3216 as there is a semi colon at the end of the while loop for that it will not run . U can check it in ur compiler.❤
@@sumontagarai9228 it will run and it will run infinite times but nothing print.
Yaa bro i have now seen it thanks for your cooperation.❤️
@@sumontagarai9228 I write that code in upper comment if u write printf("%d ", i) in between while(I
You are an extraordinary teacher. Thank you for your excellent explanation.
Mza aa gya sir ji ....
Bhut hi achhe se pdhaya hai aapne
Thank u...❤🎉
sir whole lecture is great but please make a separate lecture for switch, go to etc... miscellaneous which is important for exam point of view..
1:56:52 Yaha par while loop infinite mode me chala jayega just because of that semicolon (;) .... Infinite mode me islie jayega kyuki i ki value hamesha 1 hi rhegi aur condition ko baar baar satisfy karega i.e. 1 is always less than 10.
Great observation
Complete dekhliya Maza aa gya Sir. Thank you Sir
ITS REALLY HELPFUL SIR, THANKS A LOT SIR;
1:57:06 No output as while is already terminated in the first line.
Generalized Code For Printing Reverse Of A Number :
lastdigit = number % 10 ;
reverse = (reverse *10) + lastdigit ;
n= n/10 ;
In this code we do not print reverse of 2000 we get 2 as answer or any number which last with zero will not work in this code. Write code for every number not for specific number.
2:21:53 Problem 19 : Program to count digits of a given number
2:31:20 Problem 20 : Program to print sum of digits of a given number
2:39:26 Homework 7 : Program to print sum of even digits of a given number
2:40:22 Problem 21 : Program to print reverse of a given number
2:53:27 Homework 8 : Program to print sum of given number and its reverse
2:54:04 Problem 22 : Print sum of series - 1+2-3+4-5+6.. upto ‘n’ terms
3:07:40 Problem 23 : Print the factorial of given number
3:16:09 Homework 9 : Print the factorials of first ‘n’ numbers
3:21:43 Problem 25 : Print the nth fibonacci number
3:38:36 Homework 10 : Print the first ‘n’ fibonacci numbers
3:39:39 Problem 26 : Given 2 numbers ‘a’ and ‘b’ , find ‘a’ raised to the power ‘b’.
3:48:09 Problem 27 : Print all alphabet and their corresponding ASCII values
3:55:31 Homework 11 : Print all armstrong numbers between 1 and 500
Same problem bro
SIR YOU ARE A GOOD TEACHER
BEST TEACHER
AAPKA PADHYA HUA BAHUT JLDI SAMJH AA JATA HAI
Sir your language is very simple we want more videos asap 😄😄😄😄
thank u so much sir to make my coding journey easier
sir I completed the whole lecture and it was seriously amazing
But sir in wap to reverse a given number 2:49:00
*If i want to reverse 120 it gives 21..and not 021*
Other non zero digit are going good
Lightning lecture sir❤️🔥⚡
one of the best thank you raghav sir for free lecture
maja aaga pura lec dekh liye ache se sabkuch samaz aa gya u r best sir jiii
2:15:52 The output is- 3 1, 1 3, 0 4, -1 5 not only 3 1
because of garbage value of z i guess
sir forgot to repeat the loop
Yes loop will repeat again
yes loop will repeat again
hw question output is-40, 31, 22, 13, 04
thank you sir best explaination
maja aagya pura lecture complete dekh liya aur sab samajh aagaya
Sirji, thanks for this lecture series. Maza aa gaya🤩
I'm just dealing with this subject becoz of your content and the way of teaching is commendable sir .
"Aap same us feel ke satb samjhate h jis tarah hum first time kisi language ko padhte wakt feel karte hain, ek alag he world lagta h pehel baar ye sab dekh or padh kar
😂sachhi me
sir maza aa gya, please bring lec4 asap and thank you so much
Its really best. Even like eny other's teaching 🎉
Thank u 😊sir for this amazing lecture ❤ Maza aa gya😁
Sir we need a teacher like you 😀
Kha sa ji
Who are now second semester? ❤and understand this lecture very easy way 💚
Great lecture sir!! Bohot Maja aya.
Thanku sir Maja aa gya ❤️🌺 yha tak sare lacture dekh liye
I am waiting .. For new lecture... 🤗🤗
Sir you are the best teacher for coding
And i comple this full episode of loop
And I am very excited for your new video
Thank you so much sir mja aagya 💞💫
Thank you so much sir 🙏🙏❤❤😊😊 Excellent lec 💯🤩👍
This video is very helpful for me thanks you sir