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

What is meant by maskable interrupts, A interrupt that can be turned off by...

A interrupt that can be turned off by the programmer is called as Maskable interrupt.

What is repository info. systems, What is Repository Info. Systems? It ...

What is Repository Info. Systems? It is a tool with which you can create data stored in the ABAP/4 Dictionary available

How to reduce total amount of disk space in ftp, Q. How to reduce total amo...

Q. How to reduce total amount of disk space in FTP? FTP service compress files to reduce total amount of disk space the files require. Before transferring a file user should te

Concepts of an address and data, The heart of a computer is often one integ...

The heart of a computer is often one integrated circuit; one typical circuit is a 68Hc11 Microprocessor. Let us consider a typical 68Hc11 hardware design.           The mic

Explain working of counters, Q. Explain working of Counters? A counter ...

Q. Explain working of Counters? A counter is a register that goes through a predetermined sequence of states when clock pulse is applied. In principle value of counters is incr

What is swapping, What is swapping?   A process can be swapped out tempo...

What is swapping?   A process can be swapped out temporarily of memory to a backing store and after that brought back in memory for execution as continued.

use and benefits of object-oriented programming, The Chocolate Delights Ca...

The Chocolate Delights Candy Company requires to add the following functionality to its cash register: When a customer is checking out, the cash register requires keeping the ne

What is a program counter, It is a 16 bit special function register in the ...

It is a 16 bit special function register in the 8085 microprocessor. It remains track of the next memory address of the instruction that is to be implemented once the implementatio

How to set cell properties in dreamweaver, Q. How to Set Cell Properties in...

Q. How to Set Cell Properties in dreamweaver? Cell height determines the height of space within a cell row. Notice the space around Compass logo. You want to remove the extra s

Xml can play when dynamically generating html pages , Explain the role that...

Explain the role that XML can play when dynamically generating HTML pages from a relational database? Ans) Even if student has never participated in a project involving this typ

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