initialization of 2d array

1.1.5 Two-Dimensional character Array operations (Searching Elements, Copying, Merging, Finding length of given string)

#include<stdio.h>#include<conio.h>#include<string.h>void main(){ char fruits[5][10],ans,tmp[10],ser[10],rep[10]; int i,j,ch,len,flag=0,loc; clrscr(); for(i=0;i<5;i++) {  printf(“Enter fruits:”);  scanf(“%s”,fruits[i]); } do {  printf(“n1.Sorting”);  printf(“n2.Display”);  printf(“n3.Find Length”);  printf(“n4.Search”);  printf(“n5.Copy the name at specified location”);  printf(“nEnter Ur Choice:”);  scanf(“%d”,&ch);  switch(ch)  {   case 1:    for(i=0;i<5;i++)    {     for(j=i+1;j<5;j++)     {       if(strcmp(fruits[i],fruits[j])>0)       {          strcpy(tmp,fruits[i]);          strcpy(fruits[i],fruits[j]);          strcpy(fruits[j],tmp);  …

1.1.5 Two-Dimensional character Array operations (Searching Elements, Copying, Merging, Finding length of given string) Read More »

1.1.2 Two-Dimensional numeric Array operations (Addition, Subtraction, Multiplication, Transpose)​

The addition or subtraction of two matrices is possible only when both matrices are of same order. Addition or subtraction of two matrices of the same order can be obtained by adding or subtracting the corresponding elements of these matrices. It is obvious that the order of the new matrix is also same as order …

1.1.2 Two-Dimensional numeric Array operations (Addition, Subtraction, Multiplication, Transpose)​ Read More »

1.1.1 Declaring Two-Dimensional numeric array​

 Two Dimensional arrays are used to represent the two-dimensional structures like matrix, tables, etc. Matrix is a collection of rows and columns. Matrix can be represented as a Table in ‘C’ using 2-D Arrays or double-subscripted array. Syntax: data-type array-name[row_size][col_size]; where row_size denotes total no. of rows and col_size denotes total no. of columns. Consider the following …

1.1.1 Declaring Two-Dimensional numeric array​ Read More »