array in c Hindi | array in c programming with examples

array in c Hindi | array in c programming with examples

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

Array in c programming with examples

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.

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.
array in c programming with examples
array in c Hindi

Types Of Array in c

  • One Dimensional Array
  • Multi Dimensional Array

1.One Dimensional Array

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<stdio.h>
#include<conio.h>

  int main()
   {
      int i, num[5]={1,2,3,4,5};
      for(i=0;i<num;i++);
       {
          printf("%d\n",num);
       }
      getch();
  }

Output

1
2
3
4
5

Memory Representation

2.Multi Dimensional Array

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 <stdio.h>
#include <conio.h>

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++ ){
           {
              printf("[%d][%d]= %d\n",i,j,arr[i][j]);

           }
        }
getch();
}

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

Dosto mujhe ummed hai ki aap array in c 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 |

Danish Ali

I Am a 1st Sem BCA Student & I have Skills C, C++ ,Python, HTML,CSS, Computer & Advance Hacking & Blogger & YouTuber.

Leave a Reply

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