Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

C program to modify a multidimensional array to make it one dimensional array

+1 vote
asked Apr 9, 2019 by anonymous
array input-{1,2,{8,9},3,4,{5,{10,21,{5}},6,7}}

desired output-{1,2,8,9,3,4,5,10,21,5,6,7}

2 Answers

0 votes
answered Apr 9, 2019 by Luiz Otávio (150 points)
0 votes
answered Apr 12, 2019 by coder
#include<stdio.h>

#include<conio.h>

void main()

{

int x[5][5],t[25],i,j,n;

printf("\nIn multidimention array\n");

printf("\nEnter array size:");

scanf("%d",&n);

for(i=0;i<n;i++)

{

for(j=0;j<n;j++)

  {

printf("\n%d of %d element:",i,j)

scanf("%d",&x[i][j]);

t[i]=x[i][j];

}

}

printf("\n---------------------------------------------------------------------------------------------------------\n");

printf("\nIn single dimention array\n");

for(i=0;i<n;i++)
{

printf("%d\t",t[i]);

}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...