forked from sachin-nono/codingpractice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArrayWavePrintRowWise.cpp
More file actions
49 lines (36 loc) · 802 Bytes
/
ArrayWavePrintRowWise.cpp
File metadata and controls
49 lines (36 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Arrays - Wave Print Row Wise.
*/
#include<iostream>
using namespace std;
int main()
{
int m,n,i,j,x;
cout<<"Enter size :"<<endl;
cin>>m>>n;
cout<<endl<<m<<" * "<<n<<" integers are (i.e. array numbers) :"<<endl;
for(i=1;i<=m;i++) //Printing Array Numbers
{
cout<<endl;
for(j=1;j<=n;j++)
cout<<i<<j<<"\t";
}
cout<<endl;
i=1;
do //Printing Wave of Array Numbers
{
for(j=1;j<=n;j++)
{
cout<<i<<j<<" , ";
x=j;
if(x==n)
{
i++;
for(;x>=1;x--)
cout<<i<<x<<" , ";
}
}
i++;
}while(i<=m);
return 0;
}