Questions:
Write a C++ program to draw isosceles triangle using alphabets ACEGI
Explanation:
This C++ Program is example of nested loop.Below mention code is compiled in Visual Studio 2015 and output snap is attached.. If any problem you feel and want explanation feel free to contact.
Code:
Output:
Related Articles:
C++ Shapes Codes
Write a C++ program to draw isosceles triangle using alphabets ACEGI
Explanation:
This C++ Program is example of nested loop.Below mention code is compiled in Visual Studio 2015 and output snap is attached.. If any problem you feel and want explanation feel free to contact.
Code:
/**************************************************|
/*************C++ Programs And
Projects************|
***************************************************/
#include<iostream>
using namespace std;
void main() {
int value;
cout
<< "Enter the size =
";
cin
>> value;
int space = value;
int tepp = 1;
for (int i = 0; i < value; i++) {
for (int j = space; j > 0; j--) {
cout
<< " ";
}
for (int star = 0; star <= i * 2;
star++) {
cout
<< char(tepp + 64);
}
tepp
= tepp + 2;
space--;
cout
<< endl;
}
}
Output:
Related Articles:
C++ Shapes Codes
0 Questions:
Post a Comment