Search
 
SCRIPT & CODE EXAMPLE
 

C

2 dimensional array in c

#include<stdio.h>
int main(){
   /* 2D array declaration*/
   int abc[5][4];
   /*Counter variables for the loop*/
   int i, j;
   for(i=0; i<5; i++) {
      for(j=0;j<4;j++) {
         printf("Enter value for abc[%d][%d]:", i, j);
         scanf("%d", &abc[i][j]);
      }
   }
   return 0;
}
Comment

2d array in c

#include <stdio.h>
int main(){
    int scores[3][3],i,j;
    for(i=0;i<3;i++)
    {
        for(j=0;j<3;j++)
        {
            printf("a[%d][%d] = ",i,j);
            scanf("%d",&scores[i][j]);
        }
    }

printf("
 Matrix view: 
");
for (i=0;i<3;i++)
{
    for (j=0;j<3;j++){
        printf("%d	",scores[i][j]);
    }
    printf("
");
}
}
Comment

2D Array In C

// Array of size n * m, where n may not equal m
for(j = 0; j < n; j++)
{
    for(i = 0; i < m; i++)
    {  
        array[i][j] = 0;
    }
}
Comment

PREVIOUS NEXT
Code Example
C :: Initialization of a 3d array in c 
C :: how to select numeric columns in r 
C :: open with overwrite c 
C :: powershell search big files 
C :: c strcmp 
C :: getchar c 
C :: arduino empty serial buffer 
C :: command line arguments c 
C :: Write a C program to multiply two integers using pointers. 
C :: binary sorting 
C :: virtualbox how to move vmdk to another folder 
C :: round c 
C :: check command line input is a number in c 
C :: stack pop 
C :: bitwise operators 
C :: linux_reboot_magic2 
C :: type cast in c 
C :: ouverture du fichier c 
C :: C Keyword typedef 
C :: reverse a number in c 
C :: Uri/Beecrowd problem no - 1151 solution in C 
C :: Print Characters 
C :: unigine 
C :: float para numeros aleatorios em c 
C :: c type conversion 
C :: wap in c to input n numbers in an array, find out the sum of odd nos. and even nos. display the numbers whose sum is high. 
C :: c refresher 
C :: How to get the number of characters in a string without using strlen function 
C :: bit wise operation 
C :: c pass two dimensional array to function 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =