hi
i have made a programe to convert 2d array in 1 d.. program is not showing any error.. it inputs the number but on converting into 1 d it shows result like this
22-22-22-22...
kindly please help!!
Array
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

ShankeyRank #972 · 2.1K reputationPosted Aug 18, 2010, 12:30 AM EDT
sumit rana3 reputationPosted Aug 18, 2010, 5:26 AM EDT
#include
#include
main ()
{
clrscr();
int i,j,a[3][3],b[14];
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
scanf ("%d"; a[i][j]);
}
}
int k=0;
for (i=0;i<3;i++)
{
for (j=0;j<3;j++)
{
b[k]=a[i][j];
k++;
}
}
for (k=0;k<14;k++)
{
printf ("%d", b[k]);
}
getch ();
}
Sam HobbsRank #107 · 20.5K reputationPosted Aug 18, 2010, 8:11 AM EDT