Aug 13, 2015 at 7:40am UTC
#include <iostream>
using namespace std;
int main()
{
int n=7;
int j,count ;
bool prime;
cout<<"get user input >";
cin>>n;
for(int count=0;count<=n;count++)
{ for(int j=5;j>count;j++)
{
cout<<" ";
}
for(int j=0;j<count;j++)
{
cout<<prime;
}
for(int j=1;j<count;j++)
{
cout<<prime;
}
cout<<endl;
}
cout<<endl;
return 0;
}
I managed to make a diamond using x however i need to make a diamond using prime number. i tried to write the program but i'm just lost. Would be great if anyone could help
Last edited on Aug 16, 2015 at 3:17pm UTC
Aug 13, 2015 at 10:25am UTC
thank you for your reply. but i as i said i managed to do that but when it comes to prime number i really dont know how to write it
........1
......121
....12321
..1235321
123575321
..1235321
....12321
......121
........1
the output without the '.'
Last edited on Aug 13, 2015 at 10:27am UTC