Using C create a pyramid that a has square base Create an im
Using C++, create a pyramid that a has square base. Create an image using gnuplot.
Using C++, create a pyramid that a has square base. Create an image using gnuplot.
Solution
#include<iostream.h>
#include<conio.h>
void main()
{
int i,j,k;
clrscr();
for(i=1; i<=5; i++)
{
for(j=4; j>=i; j--)
{
cout<<\" \";
}
for(k=1; k<=(2*i-1); k++)
{
cout<<\"*\";
}
cout<<\"\ \";
}
getch();
}
