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 cache line, Define cache line. Cache block is used to refer to a...

Define cache line. Cache block is used to refer to a set of contiguous address location of some size. Cache block is also referred to as cache line.

Provide constructors, For this assignment, fill out the following class:   ...

For this assignment, fill out the following class:   class person { private:   string firstName;   string lastName;   int weight; public:   . . . }; You should provide cons

Determine about the term- voice synthesis, Voice synthesis Loud speakers ...

Voice synthesis Loud speakers and special software are used to output information in the form of sound to help blind and partially-sighted people; it also helps people who have d

How to input to circuit, Q. How to input to circuit? Register A bit...

Q. How to input to circuit? Register A bits as a0, a1, a2 and a3 in the corresponding X bits of the Full Adder (FA). Register B bits as given in the Figure above as in

Idiomatic translations - artificial intelligence, For this exercise you hav...

For this exercise you have to gather and report some linguistic data. Make sure your data are accurate by checking them with a native speaker if you yourself are not a native speak

What is logical address space and physical address space, What is logical a...

What is logical address space and physical address space? The set of all logical addresses generated by a program is known as a logical address space; the set of all physical a

Obstacles to is implementation - information system, Obstacles to IS implem...

Obstacles to IS implementation While information systems are now becoming the norm in most organisations the journey to this point has been a difficult one. Even in the 21st c

What is a metadata, What is a Metadata?  Metadata is information about ...

What is a Metadata?  Metadata is information about a PE. In COM, metadata is communicated by non-standardized type libraries. In .NET, this data is contained in the header port

Balanced trees and their operations, what is ment by avl tree n insertion n...

what is ment by avl tree n insertion n deletion ,2-3 tress insertion n deletion

What is the efi shell?, The EFI community has formed an open source shell e...

The EFI community has formed an open source shell environment. Rather than booting directly into a full OS, on some executions, the user can boot to the EFI shell. The shell is an

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