# C++ Programming Code Examples

## Learn C++ Language

### Nested Loop Statement in C++ Programming Language

**Nested Loop Statement in C++**

**Syntax for Nested Loop Statement in C++**

Outer_loop
{
Inner_loop
{
// inner loop statements.
}
// outer loop statements.
}

/* nested loop statement in C++ language */
// C++ program that uses nested for loop to print a 2D matrix
#include <bits/stdc++.h>
using namespace std;
#define ROW 3
#define COL 3
// Driver program
int main()
{
int i, j;
// Declare the matrix
int matrix[ROW][COL] = { { 4, 8, 12 },
{ 16, 20, 24 },
{ 28, 32, 36 } };
cout << "Given matrix is \n";
// Print the matrix using nested loops
for (i = 0; i < ROW; i++) {
for (j = 0; j < COL; j++)
cout << matrix[i][j];
cout << "\n";
}
return 0;
}

In C++, under the simplest form, each node is composed of data and a reference ('a link') to the next node in the sequence. This structure allows for efficient insertion or removal of the

C++ Program to "generate random numbers" using Linear Congruential Generator. A linear congruential generator (LCG) is an algorithm that yields a sequence of pseudo-randomized

To achieve Addition of two matrix we need 2 "Dimensional Array" and add their elements with each other, print result on screen. Enter elements of firts matrix. Enter elements of 2.

We already known that if reverse of a number is equal to the same number, it is Palindrome number. Remember it: certain variables and a loop use to get the reverse of a number which

C++ Program to generate N passwords each of 'length M'. Problem focuses on finding the N permutations each of length M. Generates random number between 1 and 10. Enter the