Wednesday, April 22, 2020

Three or multi dimensional array in C

  • Flowchart :
  • Syntax :
type name[size1][size2]...[sizeN];
  • Program :
#include<stdio.h>
#include<conio.h>

void main()
{
int i, j, k, x=1;
int arr[3][3][3];
clrscr();
printf("\n----------------3D ARRAY----------------");
printf(":::3D Array Elements:::\n\n");

for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
for(k=0;k<3;k++)
{
arr[i][j][k] = x;
printf("%d\t",arr[i][j][k]);
x++;
}
printf("\n");
}
printf("\n");
}
getch();
}

  • Output :


No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...