Write a function IsoTriangle() that takes a sizw parameter and displays an isosceles triangle with that many lines. Use the DrawBar() function as a Basis.
it should look like this:

 *
***

*****
*******
this is the drawbar() function:
/Overloaded DrawBar() program
Illustrated overloaded DrawBar functions
/
#include <iostream>
using namespace std;

void DrawBar(int Length)
/*Displays a bar of asterisks of length Length.
Length assumed>=0                           */
{
const char Mark= '*';
for (int i=0; i<Length; i++)
cout<<Mark;
cout<<endl;
}
//---------
void DrawBar(int Length, char Mark)
/*Diplays a bar of length Length using character Mark.
Length assumed>=0                                  */
{ 
for (int i=0; i<Length; i++)
cout<<Mark;
cout<<endl;
}
//----------
int main()
{
DrawBar(1);
DrawBar(2);
DrawBar(3);
DrawBar(4);
return(0);
}

Recommended Answers

All 3 Replies

can you help me using the DrawBar function?
it should look like a pyramid

A. No
B. That's not Java
C. The answer is the first result on Google no matter which part of that ancient question you search with, plagiarize away

If you don't know what language you are coding in then you need more help than anyone here is likely to give.
Regardless of language, this is an easy exercise for a beginner, so try to do it yourself before asking for help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.