Wednesday 3 February 2016

Write C++ Program to draw upside down triangle using ABCED

Leave a Comment
Questions:

Write C++ Program to draw upside down triangle using ABCED

Explanation:

This C++ Program is examples 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 = 0;
       cout << "Enter Value for the size of Triangle = ";
       cin >> value;
       int temp = value;
       for (int i = 0; i < value; i++) {
              for (int space = 0; space < i; space++) {
                     cout << " ";
              }
              for (int counting = 0; counting < temp; counting++) {
                     cout <<char(counting+65);
              }
              temp--;
              cout << endl;
       }


}

Output:

Write C++ Program to draw upside down triangle using ABCED


Related Articles:

C++ Shapes Codes
If You Enjoyed This, Take 5 Seconds To Share It

0 Questions: