-
July 15th, 2012, 10:09 AM
#1
Nested looping to create a pattern
Hi, I am working on some coursework for university at the moment, and one of the questions asks me to 'write a function that will generate the following pattern using nested looping techniques.'
Pattern:
- . . . . . . .
. - . . . . . .
. . - . . . . .
. . . - . . . .
. . . . - . . .
. . . . . - . .
. . . . . . - .
. . . . . . . -
So far I have the following code, but when I compile it I get a host of different errors.
#include <iostream>
int main()
{
int A[8][8],i,j;
for(i=0;i<8;i++)
{
for(j=0;j<8;j++)
{
if(i==j)
A[i][j]=-;
Else A[i][j]=.
}
cout << ā\nā;
}
}
I'm sorry I don't know how to add code tags on this,
Thanks in advance for any pointers.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|