By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,972 Members | 1,126 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,972 IT Pros & Developers. It's quick & easy.

Display the patteren

P: 3
Could Someone help me to display the following patteren:-
1 2 3 1 2 3 1 2 3
4 5 6 4 5 6 4 5 6
7 8 9 7 8 9 7 8 9
Aug 9 '07 #1
Share this Question
Share on Google+
3 Replies


sicarie
Expert Mod 2.5K+
P: 4,677
Sure, what do you have so far?
Aug 9 '07 #2

P: 3
Sure, what do you have so far?
This is what I've got.

#include<iostream.h>
#include<dos.h>
#include<conio.h>
#include<fstream.h>

void main()
{
clrscr();
int a[3], i, j, count=1;


for(i=0; i<3; i++)
{ cout<<"\t";
for(j=0; j<3; j++)
{
a[j]=count;
count++;
}


for(j=0; j<3; j++)
{
cout<<a[j]<<" ";

}
cout<<"\t";
}


}

The output is:-
1 2 3 4 5 6 7 8 9
Aug 9 '07 #3

P: 8
Could Someone help me to display the following patteren:-
1 2 3 1 2 3 1 2 3
4 5 6 4 5 6 4 5 6
7 8 9 7 8 9 7 8 9


<<Check it out Buddy!!!!!!!!!!!!!!!!!!!!>>>

<snip code>

Please don't spoonfeed anyone with full code; we don't do that here per the
posting guidelines of this forum. Read them first before you post. (click the
'Help' link at the top right corner of this page).

kind regards,

Jos
Aug 10 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.