Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

write a code to print inverted half pyramid using alphabets

0 votes
asked Mar 12, 2020 by ali

2 Answers

0 votes
answered Mar 14, 2020 by KalkiJ (180 points)
#include <iostream>
using namespace std;

int main()
{
      int i,j,n;
      cout<<"enter "<<endl;
      cin>>n;
      char c='A';
      for(i=n; i>0; i--)
      {
          for(j=i; j>0; j--)
          {
              cout<<c;
          }
          cout<<endl;
          c++;
      }
    return 0;
}
0 votes
answered Mar 14, 2020 by KalkiJ (180 points)
/******************************************************************************

Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <iostream>
using namespace std;

int main()
{
      int i,j,n;
      cout<<"enter "<<endl;
      cin>>n;
      char c='A';
      for(i=n; i>0; i--)
      {
          for(j=i; j>0; j--)
          {
              cout<<c;
          }
          cout<<endl;
          c++;
      }
    return 0;
}
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...