Sunday, 21 January 2018

Multi Dimensional arrays


Multi Dimensional arrays


Multi Dimensional arrays
C allows arrays of three or more dimensions. The exact limit is determined by the compiler.
The general form of multi-dimensional array is type array-name[s1][s2][s3]----------------------[sm];
 where si is the size of the ith dimension.
Some examples are:
        int survey [3][5][12];
        float table [5][4][5][3];
     survey is a three dimensional array declared to contain
180 integer type elements.Similarly table is a four dimensional
array containing 300 elements of floating-point type

Related Posts:

  • Program for Heart Symbol#include<stdio.h>#include<conio.h>main(){ int i,j; clrscr(); gotoxy(33,9); printf("  %c%c%c       %c%c%c\n",3,3,3,3,3,3); gotoxy(32,10); printf(" %c     %c   %c&nb… Read More
  • Program for PHYRAMID#include<stdio.h>#include<conio.h>main(){ int n,i,j,k; clrscr(); printf("enter the number:"); scanf("%d",&n); printf("\n\n\n\n\n"); for(i=1;i<=n;i++) { for(k=1;k<=n-i;k++) printf(" "); for(j=1;j<=2… Read More
  • Program for Multiplication table#include<stdio.h>#include<conio.h>main(){ int n,i,j; clrscr(); printf("enter the value:"); scanf("%d",&n); printf("\t"); for(i=1;i<=n;i++) printf("%5d",i); printf("\n\n"); for(i=1;i<=20;i++) {  &n… Read More
  • Program for pallendrom#include<stdio.h>#include<conio.h>main(){ int a,a1,i,sum=0,rev=0; clrscr(); printf("enter the value of a"); scanf("%d",&a); a1=a; while(a!=0) { i=a%10; sum=sum+i; rev=rev*10+i; a=a/10; } printf("the sum of… Read More
  • Program for Perfect Number#include<stdio.h>#include<conio.h>main(){ int n,n1,i,a,j=0; clrscr(); printf("enter the value of n"); scanf("%d",&n); n1=n; for(i=1;i<n;i++) { a=n%i; if(a==0) j=j+i; } if(j==n1) printf("the sum of factor… Read More

0 comments:

Post a Comment