Converting 2D Matrix Into 1D Matrix

13 comments
If you wish to convert your 2D Matrix into 1D matrix youwould be confused as to how would proceed.
No Worries Here is the code that will help you conver 2D Matrix in 1D Matrix.





#include<iostream.h>
#include<conio.h>
void main()
{   clrscr();
int a[3][3];
int b[9];
int i,j,k=0;

cout<<"Entered Elements into 3*3 matrix \n";
for(i=0;i<3;i++)
for(j=0;j<3;j++)
cin>>a[i][j];

cout<<"Matrix Entered By you is \n";
for(i=0;i<3;i++)
{for(j=0;j<3;j++)
  cout<<a[i][j]<<" ";
   cout<<endl;
}

cout<<endl;
cout<<endl;

for(i=0;i<3;i++)
{for(j=0;j<3;j++)
 b[k++]=a[i][j];

 }
cout<<"1-D Matri is \n";

cout<<endl;
for(k=0;k<9;k++)
cout<<b[k]<<" ";

 getch();

 }


13 comments:

k should be declared as 0 after the two "cout<<endl;" statements, else it shows an error like " Undefined symbol 'k' "

22 February 2016 at 23:41 comment-delete

K is initialized as 0 already

26 May 2016 at 00:50 comment-delete

medical care is what many people lack in the interior areas of the world. people face a lot of health issues everyday without solution. buy psychedelics online, Buy weed online, Buy fantanyl patches online

3 March 2020 at 05:50 comment-delete 21 October 2020 at 04:38 comment-delete

magnificentincense.com

26 December 2020 at 13:53 comment-delete

https://k2incenseonlineheadshop.com/
info@k2incenseonlineheadshop.com
k2incenseonlineheadshop Buy liquid incense cheap Buy liquid incense cheap For Sale At The Best Incense Online Shop

25 January 2021 at 02:40 comment-delete

https://syntheticworldwide.com/
sales@syntheticworldwide.com

Buy cheap liquid herbal incense at your best online shop

11 February 2021 at 02:15 comment-delete

https://syntheticworldwide.com/
sales@syntheticworldwide.com

Buy cheap liquid herbal incense at your best online shop

11 February 2021 at 02:16 comment-delete 27 February 2021 at 07:37 comment-delete 28 June 2021 at 06:58 comment-delete

to the medical condition of most patients. many people suffering from cancer, chronic pain, anxiety and man more have overcome their illment with cannabis. you can order weed from our store





9 December 2021 at 11:59 comment-delete




Our online store is one of the best in the supply of rare and high-grade (Mushrooms, Edibles. Psychedelics, and more)with absolute purity. All our products are tested to guarantee potency after production, during distribution and even storage. We ship globally in discreet and undetectable packaging using our network of trusted partners.
psilosybin mushroom 2022, trusted magic mushroom site 2022,
cheap liquid lsd, order cheap psychedelic mushroom,
cheap magic mushroom, super quality shrooms,
most potent psilocybin mushroom on the market,
best microdosing mushrooms 2022, Golden teacher mushroom for sale,
where to buy B+ magic mushroom, buy shrooms online ,
buy psilocybin mushroom overnight shipping, effective microdosing for ptsd,
buy mushroom truffles online cash on delivery, buy microdose capsules online 2021,
magic mushrooms for mental illness for sale,
buy mushies for anxiety/deppression and ptsd, cheap psilocybin mushroom, shrooms near me,
where to buy psilocybin mushroom near me, cheap psychedelic mushroom for sale,
buy caps/buttons cheap, best place to buy magic mushroom,
buy cheap fungi mushrooms, cheap strong fungus, best quality spores for sale,
buy mushroom grow kit online, buy fungi shrooms near me, cheapest magic mushrooms online,
where to buy penis envy online, where to buy mexicanna online, buy microdose capsules online,
best microdose capsule for sale,
fungi mushroom for sale, best liquid cultures online, buy spores near me, buy Nirvana mushroom near me,
buy pajaritos mushrooms near me, psychedelic mushroom near me, buy medicinal mushroom online,
buy 5-MeO-DMT, buy dmt vape pen online, buy lsd tabs online, buy dmt online, where to buy dmt,
lsd for sale, buy mushies near me, buy shrooms wholesale price, strong boomers for sale,
Buy trippy shrooms online, buy penis envy, buy albino A+, buy amazonian cubensis,
buy psilocybe cubensis, buy blue meanie, buy vietam cubensis, buy z strain shrooms,
buy boomers cubensis online, buy cubensis buy golden teacher, buy liquid lsd online
Our quality is the best you can find around and we sell in small/large quantities with guaranteed discreet delivery in good time Shipping




website...https://megapsilocybin.com/
call/text..+1(458) 201-6900
email..sale@megapsilocybin.com

15 January 2022 at 17:24 comment-delete

The 5 best casino bonuses and promotions: Play now
Get to 나주 출장안마 know our players 태백 출장샵 and enjoy the fun and 밀양 출장마사지 excitement of slot machines and 의정부 출장안마 other games at casinos around 광주 출장마사지 the world, and keep you informed.

3 March 2022 at 16:38 comment-delete
Post a Comment

Copyright 2011 Programming In C++.
Blogger Template by lordhtml / Free Blogger Template