Q3 Write a program to implement multi-dimensional array

Admin
Write a program to implement multi-dimensional array


#include<stdio.h>
int main()
{
 int tables, rows, columns;
 int Employees[2][2][3] = { { {9, 99, 999}, {8, 88, 888} }, { {225, 445, 665}, {333, 555, 777} }}; 
 for (tables = 0; tables < 2; tables++)
 {
  for (rows = 0; rows < 2; rows++) 
  {
   for (columns =0; columns < 3; columns++)
   {
    printf("Employees[%d][%d][%d] = %d\n", tables, rows, columns,Employees[tables][rows][columns]);
   }
  }
 }
 return 0;
} 
Output
Employees[0][0][0] = 9
Employees[0][0][1] = 99
Employees[0][0][2] = 999
Employees[0][1][0] = 8
Employees[0][1][1] = 88
Employees[0][1][2] = 888
Employees[1][0][0] = 225
Employees[1][0][1] = 445
Employees[1][0][2] = 665
Employees[1][1][0] = 333
Employees[1][1][1] = 555
Employees[1][1][2] = 777

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.