upside down filled isosceles triangle code C++

upside down filled isosceles triangle code C++
Di Posting Oleh : Simple Learning
Kategori : down isosceles triangle upside using nested for loop and asterisk character

Write a program which display upside down isosceles triangle using nested for loop and asterisk character
Output should be look like below image

upside down filled isosceles triangle code C++ sample image



C++ code:





#include<iostream>
using namespace std;

int main()
{
  int e=9;

  cout<<"\"Upside Down Triangle\":\n\n";

  for(int a=1;a<=5;a++)
 {
    for(int b=0;b<e;b++)
   {
    cout<<"*";  // printing asterisk character
   }
    cout<<endl;
    e=e-2;

      for(int c=0;c<a;c++)
     {
      cout<<" ";  // printing space here
     }

 }
 return 0;
}


Sample Output:
upside down filled isosceles triangle code C++ sample output
sample output

More C++ Shapes Here


0 Response to "upside down filled isosceles triangle code C++"

Post a Comment