number square, Computer Engineering

Assignment Help:
Ask question #MinimYour professor wants you to fill a two-dimensional N by N matrix with some numbers by following a specific pattern. According to his explanation as in the figure below, you have to fill the whole matrix by starting from the upper left corner. And then you continue by growing the size of the square matrix one by one. You start by filling a 1 by 1 matrix, then a 2 by 2 matrix until the n by n matrix is filled.



So, in the example given above, you have to fill a 10 by 10 matrix starting from number 4. Then, you continue from the next column (downwards) and from the next row (right to left) by incrementing the number and by storing it in the current position in the array.

Question: Given the dimension of the final matrix and the starting number, print all the elements of the final matrix.

Input specification
You will be given two integer n and s ( 5 <= n <= 100 and 1 <= s <= 100 ) where n represents the dimension of the final matrix and s represents the starting number in the upper left corner.

Output specification
Show all of the elements of the final matrix separated by a single space as in the given examples.um 100 words accepted#

Related Discussions:- number square

Define the term- encryption, Define the term- encryption The user would ...

Define the term- encryption The user would then type in O P E and card purchase will be authorised. This extra protection is used as well as encryption. Some of the new syste

What are the data types of vhdl, What are the Data types of VHDL VHDL....

What are the Data types of VHDL VHDL. A multitude of language or user defined data types can be used. This may mean dedicated conversion functions are needed to convert object

What are the concerns for growth of e-commerce in india, What are the conce...

What are the concerns for growth of e-commerce in India?  Government as Facilitator for the growth of e-commerce has taken certain steps: Promotion of competitive teleco

Explain vector-vector instructions, Vector-Vector Instructions In this...

Vector-Vector Instructions In this category, vector operands are fetched from vector register and accumulated in another vector register. These instructions are indicated with

Working of fully parallel associative processor, Q. Working of Fully Parall...

Q. Working of Fully Parallel Associative Processor? Fully Parallel Associative Processor: This processor accepts the bit parallel memory organisation. There are 2 kinds of this

What is macro, A series of keystrokes and mouse clicks that can be abbrevia...

A series of keystrokes and mouse clicks that can be abbreviated into a one keystroke or mouse click.

How to create a new object order preference, 1. In an ASCII editor, make an...

1. In an ASCII editor, make an empty text file with the extension .ord. 2. Save the file in the Dat folder of the project. 3. Click To o l s > G UI R e c o r d O p t i o n s

Minimum and maximum algorithm, For this assignment, you will need to create...

For this assignment, you will need to create an ARM assembly language code routine that implements an algorithm to search through an array and find BOTH the minimum and maximum val

What is instruction register, Q. What is Instruction Register? Instruct...

Q. What is Instruction Register? Instruction Register (IR): Here instructions are loaded before execution. Comments on figure above are as below: All representations are

Difference between write back and write through cache, What is Difference b...

What is Difference between write back and write through cache? A caching method wherein modifications to data into the cache aren't copied to the cache source till absolutely n

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd