Студопедия
Случайная страница | ТОМ-1 | ТОМ-2 | ТОМ-3
АрхитектураБиологияГеографияДругоеИностранные языки
ИнформатикаИсторияКультураЛитератураМатематика
МедицинаМеханикаОбразованиеОхрана трудаПедагогика
ПолитикаПравоПрограммированиеПсихологияРелигия
СоциологияСпортСтроительствоФизикаФилософия
ФинансыХимияЭкологияЭкономикаЭлектроника

Task 2. Multidimensional array

Читайте также:
  1. Array creation expressions
  2. Array initializers
  3. Array Pointers
  4. Creation and using one-dimensional and multi-dimensional arrays in the programming language Java.
  5. Jagged Arrays
  6. Parameter arrays
  7. Single-Dimensional Arrays

1) Write a program that reads in a real matrix 10x10 and finds the smallest element in the main diagonal and the smallest element in the secondary diagonal.

2) Write your own C program that transposes matrix. Program stores given matrix dimensions. Every single matrix element must be entered. Transposed matrix is the one with rows and columns switched.

3) Write your own C program that stores a real matrix 10x10, and finds the sum of elements in every column and product of elements in every row. The program prints the smallest sum (including parent column’s index), and the biggest product (including parent row’s index). Sums and products should be stored in one-dimensional arrays.

4) Maximal numbers of rows and columns of a matrix is predefined. Write your own main program which reads in a given number of rows and columns and, additionally, given elements. The main program prints: sum on the elements of the elements of the matrix (calls upon a function that calculates sum of elements)

5) Maximal numbers of rows and columns of a matrix is predefined. Write your own main program which reads in a given number of rows and columns and, additionally, given elements. Main program prints the maximal value of every row of a matrix (calls upon a function that finds the biggest element in a row)

6) Write a program that adds two matrices those dimensions and elements are input by a user, and then prints out the result.

7) An array A(m,n) is given. Write a program that creates an array В of the smallest elements of each row of the array.

 

8) An array В(m,n) is given. Write a program that creates an array C(n) of the sums of each column of the array B.

 

9) An array E(m,n) is given. Write a program that changes places of elements in the i-th and k-th rows:

 

10) Write a program that divides all elements of an array Р(m,n) into the maximum number of k-th column:

 

11) An array A(m,n) is given. Create an array С of elements of even columns and an array В of elements of odd rows of the array А:

 

12) An array A(m,n) is given. Create one-dimentional arrays В and С containing odd and even elements of the array A respectively:

 

13) Create an array В of element products of the columns of an array Z:

 

14) Create an array Т of the sum of elements situated in rows with negative elements on the main diagonal of the original array Z:

15) Create an array NS of rows’ numbers of an array R, where duplicated values are:

 

16) An array Q(m,n) is given. Replace negative elements of the array by the number of the column where they are situated:

 

17) Create a one-dimensional array B of elements of an array A that are smaller than Е:

 

18) Create a one-dimensional array B of elements that are situated below the main diagonal of an original array К:

 

19) An array V(n,n) is given. Replace the greatest elements of each row by s:

 

20) An array H(n,n) is given. Convert the array by dividing of all elements by the maximum element of K-th row:

 

21) Find the difference R between the maximum and minimum elements of an array W:

 

22) An array A(m,n) is given. Create an array B of positive elements of an array A:

, m = 2, n = 3.

23) An array G(m,n) is given. Convert the array by replacing elements of K-th and (К+1)-th columns:

 

24) An array D(m,n) is given. Add the value S to negative elements of the array and subtract value X out of positive elements:

 

25) Replace all positive elements in an array F(n,m) by their squares and all negative – by their cubes.

26) Create an array R of numbers of rows of an array Y(m,n) (those rows which have maximum element):

 

27) Create an array K of positive proportions of elements of n-th and s-th columns of the array:

 

28) Create a one-dimensional array B of the elements of А(n,n) array that are greater then C:

29) Create a one-dimensional array T of the elements of W(n,n) array that are smaller then D:

30) Create a one-dimensional array T of elements of an array A that are smaller than G:


Дата добавления: 2015-11-14; просмотров: 53 | Нарушение авторских прав


<== предыдущая страница | следующая страница ==>
Task 1. One-dimensional arrays| Lesson Plan Writing

mybiblioteka.su - 2015-2024 год. (0.007 сек.)