DIAMOND LOOP

Anyone knows how to make this using the header file #include<dos.h> for delaying the print out..

_____11______
____1212_____
___123123____
__12341234___
_1234512345__
_1234512345__
__12341234___
___123123____
____1212_____
_____11______

And it is so complicated..
First the 1/4 of the diamond will print first
____1
___12
__123
_1234
12345
then the second 1/4

1
12
123
1234
12345
then the 3rd 1/4

__12345
___123
____12
_____1
then the last 1/4

12345
123
12
1

using the delay for example delay(100)
we are using the header file #include.stdio> ,#include<conio.h> include<dos.h>

I don't know how to do... i'm sorry if i don't post any of my code because i don't know.. I am only beginner.. this is out assignment.. any reply will be greatfully accepted.. I'm so sorry :)))

i think it is like this but the output is asterisk (*)

#include <iostream>

int main()
{
for (int i = 0; i < 5; i++)
{
for (int j = 3 - i; j >= 0; j--)
std::cout << " ";

for (int j = 0; j < i + 1; j++)
std::cout << "* ";

std::cout << std::endl;
}

return 0;
}


i'm not familiar with the iostream...
pls.. use the printf or the stdio.h and conio.h
Topic archived. No new replies allowed.