Array in Cpp In Hindi

Array In C++ Hindi – C++ Programming Array In Hindi

C++

Array In C++ In Hindi :- C++ Array ye same data type ke variables ka collection hota hai | Cpp Array in Hindi ko samanjh ne ke liye ham examples ko dekhte hai.

C++ Array ko isliye istemal karte hai agar kisi ek student ka sab data stored karna ho to keval ham array ki help se keval ek hi vairable banayenge |

Array In C++ Hindi

For Example :-
char stud1 = “Danish” , stud2 = “azhar”, stud3 = “Ali” ;

  • Array ka data type koi sa bhi ho sakta hai.
  • Array ke variables aapne pass wale memory location par stored hota hai.
  • Array ka pahla value 0 se start hota hai.
  • Array Ka Pahla Memory Address Sabse Kam Hota hai.

C++ Programming Array In Hindi

array in c programming with examples
array in c Hindi

Types Of Array in C++ In Hindi

C++ Array 2 Type Ke Hote Hai |

  • One Dimensional Array
  • Two & Multi Dimensional Array

1.One Dimensional Array

Arrays Jisme Sirf 1 Subscript Hoti Hai | Use One Dimensional Arrays Kahte Hai |Iska Pryog Linear Rup Mai Data Ko Store Karne Ke Liye Kiya Jata Hai |

Syntax :

data_type array_name[size_of_array];
int num[5];

Syntax for Initialization

data_type array_name[size_of_array] = {value1, value2,...,value n}
int num[5] = {1,2,3,4,5};

Example Program

#include<iostream>
using namespace std;

  int main()
   {
      int i, num[5]={1,2,3,4,5};
      for(i=0;i<num;i++);
       {
          cout<<num<<endl;
       }
      return 0;
  }

Output

1
2
3
4
5

Memory Representation

2.Multi Dimensional Array

C++ Arrays Jisme Sirf 2 ya 2 se jyada Subscript Hoti Hai | Use Two Ya Multi Dimensional Arrays Kahte Hai | Iska Pryog Matrix Ya Table Ke Rup Mai Hota Hai |

Syntax

data_type array_name[ row_size ][ column_size ];
int [3][4];

Syntax for Initialization

int arr[3][4] = {1,2,3,4,5,6,7,8,9,10,11,12}; 
                   OR 
int arr[3][4] = {{1,2,3,4},{5,6,7,8},{9,10,11,12}};

Memory Representation

array in c Hindi
2 array in c

Example : Matrix multiplication Program

#include <iostream>

using namespace std;
int main() 
{

int arr[3][4] = { {1,2,3,4}, {5,6,7,8}, {9,10,11,12} };
int i, j;

    for ( i = 0; i < 3; i++ )
        {
        for ( j = 0; j < 4; j++ )
           {
              cout<<"["<<i<<"]["<<j<<"] = "<<arr[i][j]<<endl;

           }
        }
return 0;
}

Output:

[0][0]=1
[0][1]=2
[0][2]=3
[0][3]=4
[1][0]=5
[1][1]=6
[1][2]=7
[1][3]=8
[2][0]=9
[2][1]=10
[2][2]=11
[2][3]=12

C++ Array in Hindi

Also Read This Post:

Dosto mujhe ummed hai ki aap Array in C++ in Hindi  ko acchi tarah se samanj gye honge agar aap ko ye post acchi lage to mere is website ko jarur follow kre or ha agar aap video bhi dekhna chahte hai to aap mere channel ko bhi subscribe kar sakte hai. channel ka link aapko home page par mil jayega |

Leave a Reply

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