Print the pattern
ABCDE
ABCD
A B C
А В
А
Answers
Answered by
1
Answer:
// C++ code for triangular
// patterns of alphabets
#include <bits/stdc++.h>
using namespace std;
int main()
{
int i, j, n = 5;
for (i = 1; i <= n; i++)
{
for (j = i; j <= n; j++)
{
cout << (char)('A' - 1 + j) << " ";
}
cout << endl;
}
return 0;
}
// This code is contributed by
// shubhamsingh10
output
A B C D E
B C D E
C D E
D E
E
Similar questions