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

hello friends, given an expression we have to remove the unwanted brackets in that expression. Eg : (a+b) ---> a+b (a+b)*(c)-----> (a+b)*c. Please mail me if you know the logic. My mail id is : saravana6m@gmail.com. Thank you in advance :-)

1 Answers   GrapeCity, Microsoft,


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

2 Answers   Karvy, Qatar University,


write a program using 2 D that searches a number and display the number of items 12 inputs values input 15,20, 13, 30, 38, 40,16, 18, 20 ,18 ,20 enter no. to search : 20

0 Answers  


Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.

3 Answers   TCS, Vimukti Technologies, Wipro,


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  






write a program to calculate the radius for a quadratic equation use modular programming(function abitraction)hint use quadratic function

1 Answers   ICAN, Jomo Kenyatta University,


can we declare an object of a class in another class?(assume both class as public classes)

1 Answers   Microsoft,


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

0 Answers   Wipro,


Given 1 to n random number, find top 10 maximum numbers and explain the time complexity of the algorithm.

1 Answers   IMO, NetApp,


Implement a command console for changing settings on a particular object. The command console should allow you to enter a string and will return the response (very similar to a terminal session). The commands are as follows: SET propertyname=newvalue will change the target object’s member named “propertyname” to have a value equal to “newvalue”. If the input value is incompatible (i.e. an int being set to a string), print out an appropriate error message. GET propertyname will print out the current value of the target object’s member named “propertyname”. GET * will print out a list of all target object members and their current values. The system should be extensible for future commands and should accept an arbitrary object, such that another developer could insert another object into the system and rely on the command console to get and set the properties correctly.

0 Answers   ABC, Guidance Software,


Given 1 to n distinct random number of which n+1th element was duplicated. How do find the duplicate element and explain the time complexity of the algorithm.

0 Answers   Microsoft, NetApp,


3. Program to find the Sum of give series. a. (1)+(1+2)+(1+2+3)+(1+2+3+4)+……………………………….. b. 1/1+1/9+1/25+1/49+……………...

0 Answers  


Categories