Programming With C : Nested Loops and Jumping Statements- Lecture4

As we discussed in our last chapter

Loops, like if-else statements, can be nested, one within another.

While, the inner and outer loops need not be generated by the same type of control structure.

It is essential,  that one loop be completely embedded within the other  – there can be no overlap.

Therefore, Each loop must be controlled by different index.

Moreover, nested control structure can involve both loops and if-else statement.

Thus, a loop can be nested within an if-else statement, and an if-else statement can be nested within a loop.

Hence, the nested structure may be complex as necessary, as determined by the program logic.

Loader Loading...
EAD Logo Taking too long?

Reload Reload document
| Open Open in new tab

 

#include <stdio.h>

void main()

{ int i,j;

for (i=1; i<=10; i++)

       for(j=1; j<=10; j++)

           printf(“%d  ”, i*j);

Prints 1 2 3 ..10 2 4 6 ..20 ………10 20 30 ……..100

#include <stdio.h>

void main()

{ int i=1,j=1;

while(i<=10)

   { while(j<=10)

        { printf(“  %d”, i*j);

            j++;}

     i++;} }

Jumping Statements

Whereas jumping statements are also known as Loop Control Statements.

These statements are of different types

  • break
  • continue
  • goto
  • return, and
  • exit ()

 

Programming With C : Lecture 1

Programming With C : Lecture 2

C : Lecture 3

 

Published by

Gagan Deep

FOUNDER & DIRECTOR, ROZY COMPUTECH SERVICES, KUK, KURUKSHETRA (HARYANA), INDIA I am in the profession of teaching in Computer Science since 1996.  In 1996, established a professional setup “Rozy Computech Services” for providing Computer Education, computer hardware and software services. In this span of 21 years , in conjunction with Rozy’s, I also associated in Teaching with different Institutions like Assistant Professor in University College, Kurukshetra University, Kurukshetra, Guest Faculty in Directorate of Distance Education, Kurukshetra University, Visiting Faculty in University Institute of Engineering & Technology, Kurukshetra University and a Resource person in EDUSAT, Haryana. Besides, I am also serving as Guide and Mentor in various private educational institutions. Also written 7 books on computer science.

11 thoughts on “Programming With C : Nested Loops and Jumping Statements- Lecture4

  1. My spouse and I stumbled over here coming from a different page and thought
    I may as well check things out. I like what I
    see so i am just following you. Look forward to going over your web page repeatedly.

  2. Hello there, just became aware of your blog through Google, and found that it’s truly informative.
    I am going to watch out for brussels. I will be grateful if you continue this in future.

    Lots of people will be benefited from your writing. Cheers!

  3. Hello there,

    My name is Aly and I would like to know if you would have any interest to have your website here at rozyph.com promoted as a resource on our blog alychidesign.com ?

    We are in the midst of updating our broken link resources to include current and up to date resources for our readers. Our resource links are manually approved allowing us to mark a link as a do-follow link as well
    .
    If you may be interested please in being included as a resource on our blog, please let me know.

    Thanks,
    Aly

  4. The next time I read a blog, Hopefully it doesn’t disappoint me just as much as this particular one. I mean, I know it was my choice to read, nonetheless I really thought you would probably have something interesting to say. All I hear is a bunch of crying about something you could possibly fix if you were not too busy searching for attention.

  5. I’m extremely impressed along with your writing talents and also with the structure to your blog. Is that this a paid theme or did you modify it yourself? Anyway keep up the nice high quality writing, it is rare to look a great weblog like this one these days.

  6. This site was… how do you say it? Relevant!!
    Finally I have found something which helped me.
    Kudos! 0mniartist asmr

  7. I like the helpful information you supply in your articles.
    I’ll bookmark your blog and test once more here regularly.
    I am reasonably certain I will be informed lots of new stuff right here!
    Best of luck for the following! asmr 0mniartist

Leave a Reply to read book online Cancel reply

Your email address will not be published. Required fields are marked *