Perform the functionality of 2-D array through 1-D array
and in it the functions to be performed were:
(1) Display the array in 2-D format
(2) Display a particular element
(3) Display a particular row
(4) Display a particular column



Perform the functionality of 2-D array through 1-D array and in it the functions to be performed w..

Answer / sandeep

#include<stdio.h>
#include<conio.h>
void main()
{
static int *arr[5],arr1[5],arr2[5],arr3[5],arr4[5],arr5[5];
int *temp;
clrscr();
arr[0]=arr1;
arr[1]=arr2;
arr[2]=arr3;
arr[3]=arr4;
arr[4]=arr5;

for(i=0;i<5;i++)
{
for(int j=0;j<5;j++)
printf("%d ",arr[i][j]);
printf("\n");
}
getch();

}

Is This Answer Correct ?    6 Yes 4 No

Post New Answer

More C++ Code Interview Questions

We need to write the function to check the password entered is correct or not based on the following conditions.. a) It must have atleast one lower case character and one digit. b)It must not have any Upper case characters and any special characters c) length should be b/w 5-12. d) It should not have any same immediate patterns like abcanan1 : not acceptable coz of an an pattern abc11se: not acceptable, coz of pattern 11 123sd123 : acceptable, as not immediate pattern adfasdsdf : not acceptable, as no digits Aasdfasd12: not acceptable, as have uppercase character

0 Answers  


Code for Two Classes for Doing Gzip in Memory?

0 Answers  


Counting in Lojban, an artificial language developed over the last fourty years, is easier than in most languages The numbers from zero to nine are: 0 no 1 pa 2 re 3 ci 4 vo 5 mk 6 xa 7 ze 8 bi 9 so Larger numbers are created by gluing the digit togather. For Examle 123 is pareci Write a program that reads in a lojban string(representing a no less than or equal to 1,000,000) and output it in numbers.

4 Answers  


what is the diffrence between ++x , x++ pleaaaaase ???

7 Answers  


write a program to convert temperature from fa height into celcius and vise versa,use modular programming

0 Answers   Jomo Kenyatta University,






what is the use of using for loop as "for(;;)"?

5 Answers   Satyam,


Show by induction that 2n > n2, for all n > 4.

2 Answers   Karvy, Qatar University,


Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?

0 Answers   Wipro,


Write a simple encryption program using string function which apply the substitution method.

0 Answers  


write a function -oriented program that generates the Fibonacci, the current numbers of n(as input) and display them (series). In Fibonacci, the current third number is the sum of the previous number.

3 Answers  


1. Write a program using one dimensional array that calculates the sum and average of the five input values from the keyboard and prints the calculated sum and average.

2 Answers  


How do I store linked list datas into an array?

1 Answers  


Categories