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 ********* ********* ********* *** *** *** *** *** ***

14th Aug 2019, 10:13 AM
Joselin Kiruba
Joselin Kiruba - avatar
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; } }
31st Jan 2020, 7:22 PM
Abdul Moiz Soomro
Abdul Moiz Soomro - avatar