// Includes
#include "stdafx.h"
#include <iostream>
#include <conio.h>
usingnamespace std;
// Main Function
void main()
{
int x;
int y;
cout << "This program will display a triangle using the + symbol.\n\n";
for ( x = 1; x <= 7; x = x + 2 )
{
for ( y = 1; y < 7; y = y + 2)
{
cout << "+";
}
cout << endl;
}
_getch();
}
#include "stdafx.h"
#include <iostream>
#include <conio.h>
usingnamespace std;
// Main Function
void main()
{
int x;
int y;
cout << "This program will display a triangle using the + symbol.\n\n";
for ( x = 1; x <= 7; x = x + 2 )
{
for ( y = 0; y < x; y++)
{
cout << "+";
}
cout << endl;
}
for ( x = 5; x >0; x = x - 2 )
{
for ( y = x; y > 0; y--)
{
cout << "+";
}
cout << endl;
}
_getch();
}