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
Answer Posted / 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 View All Answers
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
Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?
Write a simple encryption program using string function which apply the substitution method.
Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)
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+……………...
Ask the user to input three positive integers M, N and q. Make the 2 dimensional array of integers with size MxN, where all the elements of I (I = 1,…,M) line will be members of geometrical progression with first element equal to the number of line (I) and denominator q.
write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n
How to Split Strings with Regex in Managed C++ Applications?
write a program using virtual function to find the transposing of a square matrix?
Teta-Omeg-Big-Oh Show that f(n) = n2 + 3n3 is ;(n3).
Performance Algorithm A performs 10n2 basic operations and algorithm B performs 300 lg n basic operations. For what value of n does algorithm B start to show its better performance?
i really need help about this.. write a program to display the set of odd and even numbers separately. find the highest and lowest value of the given numbers.
create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file
develop a program to calculate and print body mass index for 200 employees
how to write a program that opens a file and display in reverse order?