Questions:
Right Triangle pattern using Capital alphabets in reverse triangle order
Code:
#include<iostream>
using namespace std;
void main()
{
//Right Triangle pattern using Capital alphabets in reverse triangle order
int square;
cout<<"Enter The Size of Square = "; // size
cin>>square;
for(int i = square;i>=1;i--) // outer loop
{
for(int j=1;j<=i;j++) //inner loop
{
cout<<char(j+64)<<" "; // value that is output
}
cout<<endl;//new line for next line output
}
}
Output
Right Triangle pattern using Capital alphabets in reverse triangle order
Code:
#include<iostream>
using namespace std;
void main()
{
//Right Triangle pattern using Capital alphabets in reverse triangle order
int square;
cout<<"Enter The Size of Square = "; // size
cin>>square;
for(int i = square;i>=1;i--) // outer loop
{
for(int j=1;j<=i;j++) //inner loop
{
cout<<char(j+64)<<" "; // value that is output
}
cout<<endl;//new line for next line output
}
}
Output
0 Questions:
Post a Comment