Computer Science, asked by mandavabharthi8, 9 months ago

Write a program that reads in a number n and prints out the letter T using '*' characters. The horizontal line in the 'T' should have length 3n and width n, and the vertical line below it should have length 2n and width n. Thus, for n=3 your program should print as follows.

*********
*********
*********
***
***
***
***
***
***

Answers

Answered by shubhamkumarshk007
5

Answer:

#include<simplecpp>

main_program{

cout<<"how many asterics?";

int n;

cin>>n;

repeat(n){

repeat(3*n){

cout<<"*";

}

cout<<endl;

}

repeat(2*n){

repeat(n){

cout<<" ";

}

repeat(n){

cout<<"*";

}

cout<<endl;

}

wait(5);

}

Answered by poojan
20

Language used: Python Programming

Program:

n=int(input())

#For the top horizontal line of T

for i in range(0,n):

  print('*'*(3*n))

#for the bottom vertical line in T

for i in range(0, 2*n):

  print(' '*n,end='')

  print('*'*n)

Sample output is attached below with n=3,4,5 as inputs.

Learn more:

Write a Python function sumsquare(l) that takes a nonempty list of integers and returns a list [odd,even], where odd is the sum of squares all the odd numbers in l and even is the sum of squares of all the even numbers in l.

brainly.in/question/15473120

Python program to find absolute difference between the odd and even numbers in the inputted number.

brainly.in/question/11611140

Attachments:
Similar questions