C
curiousEngine
Hello. I've been able to write a tree in pascal with 21 stars. But in C
++, given the new pre-requisite to adjust for tiers, i think i need
help!
The tree consists of a series of tiers (three in this case) of
increasing size. Write a
program to produce such a display having prompted the user for the
number of tiers.
You could try putting a few baubles on the tree (using o or O).
************************************/
#include<iostream>
using namespace std;
const char star = '*';
const char space = ' ';
void main(){
int noStar(1);
/* int numTiers(0);
cout<<"Enter the number of tiers for the tree: ";
cin>> numTiers;
*/
for(int i(1); i <= 20; i++){
for (int j(1); j = (21 - i); j++)
cout<<space;
for (int c(1); c = (2*i - 1); c++)
cout<<star;
}
cout<<endl;
}
++, given the new pre-requisite to adjust for tiers, i think i need
help!
The tree consists of a series of tiers (three in this case) of
increasing size. Write a
program to produce such a display having prompted the user for the
number of tiers.
You could try putting a few baubles on the tree (using o or O).
************************************/
#include<iostream>
using namespace std;
const char star = '*';
const char space = ' ';
void main(){
int noStar(1);
/* int numTiers(0);
cout<<"Enter the number of tiers for the tree: ";
cin>> numTiers;
*/
for(int i(1); i <= 20; i++){
for (int j(1); j = (21 - i); j++)
cout<<space;
for (int c(1); c = (2*i - 1); c++)
cout<<star;
}
cout<<endl;
}