Posts

Showing posts with the label nested loop program example

How To Write Hello World Program In C++ Programming Language

Image
  How To Write a Hello World Program In C++ Programming Language In this post we will look at how a C++ program works. We will try make the example as simple as possible for the beginners so they can easily understand the basics of C++. We will write a simple C++ hello world program in C++ programming language which is considered as the very first program in almost every programming language. A Brief Introduction to the C++ Programming Language C++ is an object oriented programming language and it is an extension to C programming language. C++ is a general purpose programming language and it is also a case-sensitive language. C++ is very powerful programming language it has features of both low level and high level programming languages, and that is why it is called mid level programming language. Hello World program in C++ programming language Above is an example of a simple Hello World program in C++ programming language. Now let us look at the code, and I will take you...

Nested Loops in C Programming Language

Image
  Nested Loops in C Programming Language In programming languages, we have control statements or looping statements which are the following, 1) while-loop 2) do-while loop 3) for loop we have seen loop implementation one at a time i.e., one loop type implemented in the program. Now we will look at how to use the nested loops in the C programming language. The first thing to keep in mind is what we mean by the term nested loop. The main idea behind nested loops is to place a loop inside another loop. In this article, we are going to look at nested for loops in the C programming language. As we previously discussed we can use a loop inside another loop. So today we are going to look at how we can use a for loop inside another for loop .  Remember that if we have two for loops one for loop inside another for loop, and if both the loops are set to three iterations, then for each iteration of the outer loop the inner loop will execute three times i.e. if the outer loop runs ...