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!!
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sam HobbsPosted Aug 18, 2010, 12:11 PM
sumit ranaPosted Aug 18, 2010, 9:26 AM
#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 ();
}
ShankeyPosted Aug 18, 2010, 4:30 AM