C Programming language

adplus-dvertising
C Program example: A program for two dimensional Array
Previous Home Next
A simple program of two dimensional Array
/** A simple program of two dimensional Array **/

#include<stdio.h> 
#include<conio.h> 
void main() 
{ 
	int i, j; 
	int num[3][3]={ 
	{20, 48, 65}, 
	{89, 34, 70}, 
	{90, 75, 49} 
	}; 
	clrscr(); 
	printf(" Elements of 2D array\n\n"); 
	for(i=0;i<3;i++) 
	{ 
		for(j=0;j<3;j++) 
		{ 
			printf ("%d\t", num[i][j]); 
		} 
		printf("\n"); 
	} 
	getch(); 
} 
Output :

Elements of 2D array

20     48     65

89     34     70

90     75     49

Previous Home Next