C Language Example # 45 2D Array Simple Example.
* This program demonstrate 2D Array Simple Example. Program will scan 3x3 values from user and will display the same value as output.
* This program demonstrate 2D Array Simple Example. Program will scan 3x3 values from user and will display the same value as output.
//Written by : Latest Technology Guide
//Title : C Language Example # 45 2D Array Simple Example.
#include <stdio.h>
#include <conio.h>
void main()
{
clrscr();
int a[3][3],i,j;
printf("\n\t : Enter the value in 3 x 3 Array : \n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("Enter Value of A[%d][%d] = ",i,j);
scanf("%d",&a[i][j]);
}
}
printf("\n\t : Now see the Entered Array in A : \n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%3d",a[i][j]);
}
printf("\n");
}
getch();
}
#include <conio.h>
void main()
{
clrscr();
int a[3][3],i,j;
printf("\n\t : Enter the value in 3 x 3 Array : \n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("Enter Value of A[%d][%d] = ",i,j);
scanf("%d",&a[i][j]);
}
}
printf("\n\t : Now see the Entered Array in A : \n");
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
{
printf("%3d",a[i][j]);
}
printf("\n");
}
getch();
}
Output:
--------------------------------------------------------------------------------
Explanation of C Programming Language Example # 45 2D Array Simple Example.
* You need to value of 3x3 matrix and program will display this value.
Note: All programs are developed and tested using Turbo C++ 3.0 under Windows XP. We just want to provide guidelines to the users. If you are using any other Compiler or other operating system they you need to modify this program as per your requirements.
3x3 with add,multi, digonal sum, max number. plz give me use for array. Thank
ReplyDeletethank you for sharing nice article in your blog
ReplyDeletevisit
web tutorial programming
https://www.welookups.com