0
Write a c++ program to print letter T using * character,the horizontal line in T of length 3n & width n ,vertical line l 2n &w n
Write a c++ program to print letter T using * character,the horizontal line in T of length 3n & width n ,vertical line l 2n &w n Output for n=3 ********* ********* ********* *** *** *** *** *** ***
1 Réponse
0
#include<iostream>
using namespace std;
int main()
{
int i,j,n;
cout << "Enter the Value of n:";
cin >> n;
for(i=1;i<=n;i++)
{
for(j=1;j<=3*n;j++)
{
cout << "*";
}
for(j=1;j<=n;j++)
{
if(i==n)
{
break;
}
cout << endl;
}
}
cout << endl;
for(i=1;i<=2*n;i++)
{
for(j=1;j<=n;j++)
{
cout << " ";
}
for(j=1;j<=n;j++)
{
cout << "*";
}
cout << endl;
}
}