{"id":11049,"date":"2021-09-30T15:00:24","date_gmt":"2021-09-30T09:30:24","guid":{"rendered":"https:\/\/python-programs.com\/?p=11049"},"modified":"2021-11-22T18:34:29","modified_gmt":"2021-11-22T13:04:29","slug":"python-program-to-print-square-star-pattern","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-print-square-star-pattern\/","title":{"rendered":"Python Program to Print Square Star Pattern"},"content":{"rendered":"

Are you a job seeker and trying to find simple java programs for Interview?<\/a> This would be the right choice for you, just tap on the link and start preparing the java programs covered to crack the interview.<\/p>\n

Given the number of rows and a number, the task is to print a square star pattern in C, C++, and Python.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

given number of sides of square =13<\/pre>\n

Output:<\/strong><\/p>\n

* * * * * * * * * * * * * \r\n* * * * * * * * * * * * * \r\n* * * * * * * * * * * * * \r\n* * * * * * * * * * * * * \r\n* * * * * * * * * * * * * \r\n* * * * * * * * * * * * * \r\n* * * * * * * * * * * * * \r\n* * * * * * * * * * * * * \r\n* * * * * * * * * * * * * \r\n* * * * * * * * * * * * * \r\n* * * * * * * * * * * * * \r\n* * * * * * * * * * * * * \r\n* * * * * * * * * * * * *<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

given number of sides of square =7\r\ngiven character to print =@<\/pre>\n

Output:<\/strong><\/p>\n

Enter some random number of sides of the square = \r\n7\r\nEnter some random character to print = \r\n@\r\n@ @ @ @ @ @ @ \r\n@ @ @ @ @ @ @ \r\n@ @ @ @ @ @ @ \r\n@ @ @ @ @ @ @ \r\n@ @ @ @ @ @ @ \r\n@ @ @ @ @ @ @ \r\n@ @ @ @ @ @ @<\/pre>\n

Program to Print Square Star Pattern in C, C++, and Python<\/h2>\n

Below are the ways to print square star pattern in C, C++, and Python.<\/p>\n