#12: while Loop in C Programming | C Programming for Beginners

Sdílet
Vložit
  • čas přidán 22. 07. 2024
  • In this video, we will learn about while loop in C Programming. Here, we will learn to use a while loop to repeat a block of code multiple times and then create a multiplication table.
    This video is a part of our C Programming video series: • #1: Getting Started wi...
    Resources:
    C Online Compiler: www.programiz.com/c-programmi...
    Github File: github.com/programiz/c-youtub...
    C while Loop Tutorials (text-based): www.programiz.com/c-programmi...
    Timestamps:
    00:00 - Start
    00:31 - while Loop
    05:01 - Create Multiplication Table
    08:59 - do...while Loop
    10:51 - while Vs. do...while Loop
    11:53 - Programming Task
    12:25 - Quiz
    Revise your learning using our C App
    Download here for Android: bit.ly/3upaInx
    Download here for iOS: apple.co/3EZLtNq
    Find Programiz elsewhere:
    Website: www.programiz.com
    Facebook: / programiz
    Instagram: / _programiz
    LinkedIn: / programiz
    Twitter: / programiz
    #whileloop #cprogramming #learnc #dowhile #loop

Komentáře • 333

  • @programizstudios
    @programizstudios  Před 2 lety +7

    🔥Finding it Damn Hard to Understand C Programming?
    Learn to code-the right way-with interactive lessons, quizzes & challenges. Build a strong programming base; it's IMPORTANT!
    Try Programiz PRO for Free: bit.ly/master-c-programming

  • @aderitobentoderi6429
    @aderitobentoderi6429 Před 4 měsíci +7

    I was reading a programming book without understanding much, but the way she explains it is amazingly simple and easy, thank you very much, you saved my learning, now I'm more interested in programming

  • @girmamihrete4597
    @girmamihrete4597 Před rokem +18

    // Online C compiler to run C program online
    //The program that can display a multiplication table with decrement value using while loop.
    #include
    int main() {
    int number;
    printf("Enter the number: ");
    scanf("%d", &number);
    int count=10;
    while (count >= 1)
    {
    int product = count * number;
    printf("%d x %d = %d
    ", number, count, product);
    count = count-1;
    }
    return 0;
    }

  • @sakthimuruganr2547
    @sakthimuruganr2547 Před rokem +56

    int main() {
    int number;
    printf("Enter the Number: ");
    scanf("%d", &number);
    int count = 10;
    while (count >= 1){
    int product = number * count;
    printf("%d*%d =%d
    ",number,count,product);
    count -= 1;
    }
    return 0;
    }

  • @saibinayak4529
    @saibinayak4529 Před rokem +34

    I can watch these videos all day
    The way she explains all these ao sweetly and everything is short and 1precise thank you for this beautiful playlist👍

  • @zi_AFRICAN_PRINCE
    @zi_AFRICAN_PRINCE Před měsícem +10

    who is here in 2024

  • @bloomcreation4578
    @bloomcreation4578 Před rokem +6

    Before studying my lectures notes, I must watch these tutorials because they make my studies easy ......thanks programiz

  • @nihatdonmzov4166
    @nihatdonmzov4166 Před rokem +6

    Your way of teaching is so beautiful. Thank you so much!

  • @user-nt4nm4fb3u
    @user-nt4nm4fb3u Před 6 měsíci +3

    As always great crystal clear explanation! Thank you very much for everyone who are making this happen.

  • @hdidev6880
    @hdidev6880 Před rokem +5

    the best c tutorial in youtube , thanks a lot Padma 😍🙏👌

  • @PicturePerfectDiaries
    @PicturePerfectDiaries Před rokem +7

    For quiz.....
    To terminate the loop condition should be false and in this code value is always true hence all of these options are i finite loops...
    So the answer is option D

  • @ucheemmanuel8466
    @ucheemmanuel8466 Před rokem

    look you've improved me so much!!!!! i really love your channel and i just wanna say God bless you deeply!!

  • @seabasschukwu6988
    @seabasschukwu6988 Před rokem +3

    this was a harder concept to teach but you did an excellent job

  • @emmanuellegentil9930
    @emmanuellegentil9930 Před 2 lety

    Hello ma'am,
    I have a question!!!
    Can while loop be used to count and display the frequency of each character in a string in the form of descending order??

  • @faisal_tarshon
    @faisal_tarshon Před 7 měsíci

    Thank you, you guys made c more fun and easy to understand!

  • @21pradaofficial4
    @21pradaofficial4 Před rokem +2

    Thank God for your channel and videos 💪🏽🔥🔥❤

  • @dennispeter2557
    @dennispeter2557 Před 2 lety

    that cool🙏🙏 i was looking for programming help and i found your 🙌👉lec too high keep the fire burning 💥💥💥💥💥🙌🙌🙌

  • @akshitaprajapat225
    @akshitaprajapat225 Před 2 lety +1

    Thank you so much ma'am
    This is really very helpful to me 🥰🥰🥰🥰🥰
    And your accent is so understable 🙏🙏🥰🥰
    Please ma'am keep doing this
    I'm also using that app 😊

  • @dom_200
    @dom_200 Před 2 měsíci

    That was a great work done. I really enjoyed the lesson. The explanations and introductions are 100% but please the terms such as printf and scanf need some highlights for the beginners.

  • @P.R.Govtcollegekkd
    @P.R.Govtcollegekkd Před 2 lety

    May i know what's the difference between for loop and while loop

  • @arpitasingh779
    @arpitasingh779 Před 2 lety +1

    Where well explained keep uploading more lecture 🎉🎉

  • @williamowusu7778
    @williamowusu7778 Před rokem

    I declared the product variable outside the while loop but after I tried printing it is not responding as it should please why?

  • @ishaangupta2353
    @ishaangupta2353 Před 5 měsíci

    Ma'am I have a question.
    in the programiz quiz part the 3 option is missing the ';' but still the answer is all of the above. How?

  • @kk_dipper_1549
    @kk_dipper_1549 Před 7 měsíci +1

    I'm sooooo thankful for u!!!!
    Thank you so much!!

  • @hurulaynmuhamedsalimcedarp5770

    I'm looking forward to your next video.

  • @programizstudios
    @programizstudios  Před 2 lety +27

    Q. Which of the following causes an infinite loop?
    1. while (1) {...}
    2. int i = 3;
    while (i < 4) {...}
    3. int i = 3
    do {
    ...} while(i < 4)
    4. All of the above

  • @user-kz4bh4up3b
    @user-kz4bh4up3b Před 2 lety

    Very nice lecture. Thank you

  • @williamowusu7778
    @williamowusu7778 Před rokem +1

    Thanks I'm getting better at C

  • @kelvinlikweta1232
    @kelvinlikweta1232 Před rokem

    Where do I find answers to the test questions you give?

  • @akshitaprajapat225
    @akshitaprajapat225 Před 2 lety

    Ma'am lemme know the condition for "do ,loop" to print any table
    I tried but couldn't 😑

  • @maica2476
    @maica2476 Před 7 měsíci

    programming is really hard for me but i love learning new things

  • @nihatdonmzov4166
    @nihatdonmzov4166 Před rokem +1

    Thank you so much!

  • @HellensAngels
    @HellensAngels Před 3 měsíci

    The "do {} while var;" loop is beautiful 🤩

  • @sirishasaragadam7603
    @sirishasaragadam7603 Před 2 lety +3

    Thank you mam☺

  • @nuetrkn
    @nuetrkn Před rokem

    You are amazing 👏🙌👏

  • @bignaughtydog
    @bignaughtydog Před rokem +3

    /* Example 3. While program to print multiplication table from 10 to 0.*/
    #include
    int main(){
    int number;
    printf("Please enter a number to be multiplied: ");
    scanf("%d", &number);
    int count = 10;
    while(count >= 0) /* This is the test expression*/
    {
    int product = count * number; /* This is the body of the do loop*/
    printf("%d * %d = %d
    ", number, count, product);
    --count;
    }
    return 0;
    }

    • @meriem.br0
      @meriem.br0 Před 6 měsíci

      which one the causes is an infinite loop, is it B ?

  • @BTS-ct1ce
    @BTS-ct1ce Před 2 lety +7

    Your tone accent is Indian are you Indian?
    By the way you teach really well 😊 Thank you so much it helps so much!!

  • @adymainz
    @adymainz Před rokem +1

    kindly do c++,pascal,C#,java and xml totorials plz

  • @amitube663
    @amitube663 Před rokem +3

    #include
    int main (){
    // multiplication table for a agiven, that prints from 10 to 1.
    int number;
    printf("Enter number: ");
    scanf("%d", &number);
    int count=10;
    while(count>=1){
    int product=number*count;
    printf("%d*%d=%d
    ", number, count, product);
    count = count-1;
    }
    return 0;
    }

  • @One_piece1089
    @One_piece1089 Před 11 měsíci

    amazing teacher😍

  • @ozgeylmaz8685
    @ozgeylmaz8685 Před rokem

    great tutorials

  • @emmanuelarthur3081
    @emmanuelarthur3081 Před rokem

    Great video ❤

  • @hridhanpatel3987
    @hridhanpatel3987 Před 2 lety +11

    Extremely useful lectures ❤️🔥😀
    By how much time all of advanced C programming course will be completed?

    • @programizstudios
      @programizstudios  Před 2 lety +8

      We will continue the series until all the important topics are covered. So stay tuned for new episode and a lot of other resources every week. Thank you for sticking with us.

    • @hridhanpatel3987
      @hridhanpatel3987 Před 2 lety +2

      Okay great 👍
      Thanks 😊

    • @adymainz
      @adymainz Před rokem

      @@programizstudios kindly do c++,pascal,C#,java and xml totorials plz

  • @Selcuk._._
    @Selcuk._._ Před 3 měsíci

    Can it get any shorter than that?
    int num, count = 11;
    printf("Enter number: ");
    scanf_s("%d", &num);
    while (count-- > 1) printf("%d x %d = %d
    ", num, count, num * count);

  • @hurulaynmuhamedsalimcedarp5770

    I love your videos

  • @shivamchauhan6404
    @shivamchauhan6404 Před rokem +2

    Is the answer of the quiz is option B?

  • @shivamchauhan6404
    @shivamchauhan6404 Před rokem +2

    #include
    int main(){
    int raajbhog = 1;
    while(raajbhog

  • @rananagy6754
    @rananagy6754 Před rokem

    Thank you ❤❤❤❤❤

  • @mohammadabdullahaalforhad1375
    @mohammadabdullahaalforhad1375 Před 10 měsíci

    Thanks a lot

  • @popops3
    @popops3 Před 10 měsíci +1

    Is there a reason to not declare int product outside the while loop and then only use product = number * count; ?

    • @randommanxe2451
      @randommanxe2451 Před měsícem

      might be a little late but you can declare your product whenever you want and can you some other variable expect product as long as you declare it

  • @samadhandudhal7046
    @samadhandudhal7046 Před 2 lety +3

    Upload all lecture as early as possible

  • @khalidali696
    @khalidali696 Před 10 měsíci

    good one

  • @Mister.a1
    @Mister.a1 Před rokem

    great keep going !

  • @davidyttech
    @davidyttech Před 2 lety

    Love From Nepal

  • @60_vuhungthang66
    @60_vuhungthang66 Před 2 lety

    very nice😁

  • @janenjenga1335
    @janenjenga1335 Před rokem

    My question is why write %d what does it mean and second why inthe example code is there printf(enter number) and scanf(%d &number) what do they mean ... Please help

  • @ramjr3628
    @ramjr3628 Před 2 lety +5

    I am really bad at understanding difference between for,while and do while.So , please upload series of problems which can be solved efficiently only through while loop.

    • @nerd2544
      @nerd2544 Před 2 lety

      you need a computer science course not programming course,
      explained in one sentence: FOR and DO WHILE is a "pre-test" loop but WHILE DO is a "post-test" loop

  • @praneethbolla3449
    @praneethbolla3449 Před 12 dny

    we can use decrement like count-- cant we

  • @allanmark922
    @allanmark922 Před 9 měsíci

    very nice

  • @TAMILSELVANK-hv7vu
    @TAMILSELVANK-hv7vu Před 5 měsíci

    Very interseted in solving the code and understanding the concepts
    so the code for the programming task is :
    #include
    int main() {
    int number;
    printf("Enter the number: ");
    scanf("%d",&number);
    int count=10;
    while(count > 1){
    int product = number * count;
    printf("%d*%d = %d
    ", number,count,product);
    count = count - 1;
    }
    return 0;
    }

  • @Yukindrei
    @Yukindrei Před měsícem

    while doing the code, i realized that count++ can be used instead of count = count + 1; to look shorter and cleaner. the same with the programming task: c-- instead of count = count - 1;.

  • @keshavdixit08
    @keshavdixit08 Před rokem

    table using do while loop :
    #include
    int main() {
    // Write C code here
    int number, count, product;
    printf("Enter the number : ");
    scanf("%d",&number);
    count = 1;
    do {
    product = number * count;
    printf("%d * %d = %d
    ",number, count, product);
    count = count +1;
    }
    while (count

  • @bignaughtydog
    @bignaughtydog Před rokem

    /*C program to print the sum of all odd numbers from 1 to 100*/
    #include
    int main(){
    int sum = 0;

    for (int i = 1; i

  • @collinsderrick8802
    @collinsderrick8802 Před rokem +1

    All of above

  • @shivamchauhan6404
    @shivamchauhan6404 Před rokem +1

    // Online C compiler to run C program online
    // C program to print reverse table of any number
    #include
    int main() {
    // Write C code here
    int number;
    printf("Table of: ");
    scanf("%d", &number);
    int count = 10;
    while(count >= 1 ){
    int product = number * count;
    printf("%d * %d = %d
    ", number , count, product );

    count = count - 1;
    }
    return 0;
    }

  • @varalakshmidevathi7997

    Is answer option d

  • @Darkness-898
    @Darkness-898 Před měsícem +1

    Programming Task:
    #include
    int main() {
    int num=9;
    int count=10;
    int product;
    do {
    product=num*count;
    printf("%d*%d=%d
    ", num, count, product);
    count=count-1;
    } while(count>=1);
    return 0;
    }
    Programiz Quiz Answer: Option (D) All of the above

  • @mahbubhamim7001
    @mahbubhamim7001 Před 2 měsíci

    Beauty with brain ❤>

  • @sibtehassanbutt8775
    @sibtehassanbutt8775 Před 5 měsíci

    Thank you so much Mam.Your method of explaining is very amazing.Your lectures helped me a lot to get good marks in my exams.So much love from Pakistan💖💖

  • @adarshyadav1423
    @adarshyadav1423 Před 2 lety +4

    give us more programming tasks
    Like daily tasks

    • @programizstudios
      @programizstudios  Před 2 lety +3

      We really love enthusiastic learners like you Adarsh. Do complete the programming task of this tutorials and of previous videos and hopefully we will bring other tasks and challenges really soon stay tuned.

    • @adarshyadav1423
      @adarshyadav1423 Před 2 lety +1

      I want more programming questions on single topic so that it can easily remember me the codeing

    • @adarshyadav1423
      @adarshyadav1423 Před 2 lety +1

      Coding*

  • @gauravshrestha2718
    @gauravshrestha2718 Před 2 lety +4

    //C Program to print the reverse multiplication table of n
    #include
    int main(){
    int num;
    int count=10;
    int multiply;
    printf("Enter a value: ");
    scanf("%d", &num);
    while (count>0){
    multiply=num*count;
    printf("%d * %d = %d
    ", num, count, multiply);
    count=count-1;
    }
    return 0;
    }

    • @AkiiiMatcha
      @AkiiiMatcha Před rokem

      you can actually safe some bytes by making the multiply variable local instead of global since it wont be used in other places except the one call

  • @youssefeissa6510
    @youssefeissa6510 Před rokem

    int main(){
    int num=9;
    int counter=10;
    while(counter>=1){
    int result=num*counter;
    printf("%d * %d = %d
    ",num,counter,result);
    counter--;
    }
    }

  • @zuko8023
    @zuko8023 Před 3 měsíci

    answer is all of the above. i belive you forgot the semi-colon at the end of the do while loop

  • @WorldWorrier3273
    @WorldWorrier3273 Před rokem

    If the Explainer would be this " Beautiful😍💓 " Every ' Boring ' subject will automatically be interesting 😋 Am i Right✔ 🌹🥰
    I wish 🥀i could have got her 👧 earlier, then now i could be an Expert at C programming 🤔
    From now on " Am going to be a subscriber " Of yours 😃😋

  • @mveiyo
    @mveiyo Před rokem

    ALL of the above

  • @annachello32
    @annachello32 Před rokem +2

    Option - A

  • @shraiykhaddar
    @shraiykhaddar Před 2 lety +1

    ALL OF THE ABOVE

  • @tusharitaliya3357
    @tusharitaliya3357 Před rokem

    Lodi

  • @alinadangol9313
    @alinadangol9313 Před 2 lety +47

    The presenter is beautiful.

  • @mamunsj5594
    @mamunsj5594 Před rokem

    #include
    int main(){
    int num;
    int count = 10;
    printf("Enter the number you want to multiply ");
    scanf("%d", &num);
    while (count >= 1){
    int value = num *count;
    printf ("%d*%d = %d
    ", num, count, value);
    count--;
    }
    return 0;
    }
    Thank you Padma , I'm learnign C from last day.
    Your teaching skill is just awesome, I'm really grateful to you .

  • @JKEmma-en7gl
    @JKEmma-en7gl Před 2 lety +9

    Programming Task:
    #include
    int main() {
    int number;
    printf("Enter your number: ");
    scanf("%d", &number);
    int count = 12;
    while (count >= 0) {
    int product = number * count;
    printf("%d*%d = %d
    ", number, count, product);
    count = count - 1;
    }
    return 0;
    }

  • @yogithabale
    @yogithabale Před 29 dny

    opt A while(1){...} causes an infinite loop

  • @Hassanmalik-8118
    @Hassanmalik-8118 Před rokem

    #include
    int main()
    {
    // declare variables
    int n,m=10,o;

    /* print variables
    and take values*/
    printf("number=");
    scanf("%d",&n);
    // declare loop
    while (m > 0){
    o=m*n;
    printf("%dx%d=%d
    ",n,m,o);
    m--;
    }
    // printing result

    return 0;
    }here it is

  • @kiplangatKe
    @kiplangatKe Před rokem

    #include
    Int main(){
    Int num=9;
    Int count=10;
    While(count>=1){
    Int product =count*num;
    Printf("%d*%d=%d
    , count,num,product);
    Count=count-1;
    }
    return 0;
    }

  • @im-teazsohan1934
    @im-teazsohan1934 Před měsícem

    int main() {
    int count=10;

    while(count>=1){
    int mul=9;
    int product=mul*count;
    printf("%d*%d=%d
    ",mul,count,product);
    count=count-1;
    }
    return 0;
    }

  • @catherinemamo6837
    @catherinemamo6837 Před rokem +4

    Programming task:
    int main() {
    int count = 10;
    int num = 9; //multiplication table of 9

    do {
    int product = num * count;
    printf("%d * %d = %d
    ", num, count, product);
    count -= 1;
    } while (count >= 1);
    return 0;
    }

  • @samitpatil7391
    @samitpatil7391 Před rokem

    what is count=count+1

    • @K6619.
      @K6619. Před 7 měsíci

      it adds into a variable +1 to the number so if the initial value of count is 0 after the count=count+1 it is 1 .

  • @bryanbalantes6486
    @bryanbalantes6486 Před rokem +2

    A. while(1){....}

  • @nihatdonmzov4166
    @nihatdonmzov4166 Před rokem

    The answer of the quiz is D(all the above).

  • @emnanaitibourk5995
    @emnanaitibourk5995 Před rokem +1

    The answer of the quiz is 4
    All above

  • @rodainekennedy244
    @rodainekennedy244 Před rokem +1

    D is the answer.

  • @user-uj8ss9dp7l
    @user-uj8ss9dp7l Před měsícem

    Answer D) Default

  • @sandeep8262
    @sandeep8262 Před 7 měsíci +1

    #include
    Int main () {
    Int number = 9;
    Int count = 10;
    While (count >0) {
    Int result = number * count;
    Printf("%d*%d = %d
    , number, count, result;)
    count = count - 1;
    }
    return 0;
    }

  • @drscorpion1624
    @drscorpion1624 Před rokem +1

    option c

  • @balashebjadhav977
    @balashebjadhav977 Před 11 měsíci

    Answer is D) All of these

  • @sakthimuruganr2547
    @sakthimuruganr2547 Před rokem +1

    option 4

  • @johnezekielfombuenacervant2137

    Write a program to ask for a name until the user enters END. Print the name each time. When you are done, print "I am done."

  • @rajavelu539
    @rajavelu539 Před rokem

    12:27 option A

  • @nbtech2006
    @nbtech2006 Před měsícem

    #include
    int main()
    {
    int number,count=10;
    printf("Enter a number?");
    scanf("%d",&number);
    while(count>=1)
    {
    int product=number*count;
    printf("%d x %d =%d
    ",number,count,product);
    count=count-1;
    }
    }
    is this correct?

  • @viralfoodies1886
    @viralfoodies1886 Před rokem

    answer:option D