Computer Science, asked by patrasnehasish2000, 10 months ago

Write a program that reads in a number n and prints out n rows each containing n star characters, '*'. Thus if n is 3, then your program should print as follows.


***

***

***

Answers

Answered by ayaan12396
2

Please become my follower I am solving your doubt......

Answer:

//the display the pattern

import java.util.*;

public class Pattern

{

public static void main ()

{

Scanner in= new Scanner (System.in);

System.out.println("Enter the number or rows");

int n= in.nextInt();

//looping starts

for(int i=1;i<=n;i++)

{

for(int j=1;j<=n;j++)

{

System.out.print("*");

}

System.out.println();

}

}

}

Answered by shubhamkumarshk007
21

Answer:

#include<simplecpp>

main_program{

cout<<"how many asterics?";

int n;

cin>>n;

repeat(n){

repeat(n){

cout<<"*";

}

cout<<endl;

}

wait(5);

}

Explanation:This program is written in C++ language.

Similar questions