C program input array [3] [3] = {1,2,3,4,5,6,7,8,9} print output like this = 1,2,3,6,5,4,7,8,9

Status
Not open for further replies.

KVSN91

Junior Member level 2
Joined
Aug 27, 2015
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
182
C program input array[3][3] = {1,2,3,4,5,6,7,8,9} print output like this = 1,2,36,5,

input array[3][3] = {1,2,3,4,5,6,7,8,9}
print output Like : 1,2,3,6,5,4,7,8,9
 

Re: C program input array[3][3] = {1,2,3,4,5,6,7,8,9} print output like this = 1,2,3

You want to reverse the order of digits in array[1]. There are several ways to do it but a loop is probably simplest:
i = 0;
while(i++ < 3) print(array[0]);
while(i--) print(array[1]);
while(i++ < 3) print(array[2]);

substitute your real print function in place of the 'print' I used.

Brian.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…