© All Rights Reserved

1 views

© All Rights Reserved

- Ourexam HP0-M28 exam material
- Maze Article English
- Chapter 3&Appendix a(EC)
- B.sc Computer Science 1st Sem c Lab Record
- TOS Araling Panlipunan Final
- Adv.plsql Concepts
- Guidelines for CSB PGT Computer Science
- C-md-050 Application Extensions Functional Design-(Md-50 Template
- Examples of Arrays in c PDF
- Interview Questions on Oracle Reports 6i
- class-5 (1).pdf
- Rossiter-RIntro-ITC.pdf
- Cpphtp9 TOC
- Subsets of Real Numbers Final Corrected Tg
- 1829 Comp Sci
- 269.pdf
- 2D_arrays
- Arrays
- Arrays Function
- aAlgebra

You are on page 1of 3

Homework

Exercise 1.

Write a program that creates two-dimensional array and fills it in the following

way: the user enters a number (for example, 3), the first element of the array takes

a value of this number, the subsequent element of the array takes a value of this

number multiplied by 2 (that is, 6 for our example), the third element of the array

takes a value of the previous element, multiplied by 2 (that is, 6 * 2 = 12 in our

example). Display an array that has been created.

Exercise 2:

Write a program that creates two-dimensional array and fills it in the following

way: the user enters a number (for example, 3), the first element of the array takes

a value of this number, the subsequent element of the array takes a value of this

number multiplied + 1 (that is, 4 for our example), the third element of the array

takes a value of the previous element + 1 (that is, 5 in our example). Display an

array that has been created.

Exercise 3:

Create two-dimensional array. Fill it with random numbers and display on the

screen. The user chooses a number of shifts and position (left, right, up, down).

Run the array shift and show on screen the result. The shift is circular. For

example, if we have the following array,

120453

453901

531204

014539

1

Exercise 4:

In two-dimensional array of integers calculate:

• the sum of all elements of the array;

• the arithmetic mean of all elements of the array;

• minimum element;

• maximum element.

Exercise 5:

In two-dimensional array of integers calculate the sum of elements: in each string;

in each column; simultaneously in all strings and all columns. Do this as follows:

3 5 6 7 | 21

12 1 1 1 | 15

0 7 12 1 | 20

---------------------

15 3 19 9 | 56

Exercise 6:

Write a program that declares an array of 5x10 and an array of 5x5. The first array

is filled with random numbers between 0 and 50. The second array is filled in the

following way: the first element of the second array is equal to sum of the first and

second elements of the first array; the second element of the second array is equal

to sum of the third and fourth elements of the first array.

2

Course «C Programming Language»

Topic: Functions

Homework

Exercise 1.

Write a function that takes two parameters: a power base and a power exponent,

and finds power of a number on the base of the data obtained.

Exercise 2.

Write a function that takes as parameters two integers and returns the sum of

numbers in a range between them.

Exercise 3.

Perfect number is a positive number which sum of all positive divisors excluding

that number is equal to that number. Write a search function of numbers in the

input range.

Exercise 4.

Write a function that displays on the screen a playing card that has been referred to

it.

Exercise 5.

Write a function that determines whether a six-digit number is "a lucky number" or

not.

Exercise 6.

Write a function that takes two dates (that is, the function takes six parameters) and

calculates the difference in days between two dates. To solve this problem you

should also write a function that determines whether the year is a leap or not.

Exercise 7.

Write a function that determines the arithmetic mean of elements of the passed

array.

Exercise 8.

Write a function that determines a number of positive, negative and zero elements

of the passed array.

- Maze Article EnglishUploaded byAndy Bass Slap
- Chapter 3&Appendix a(EC)Uploaded bysazzadsakir77
- B.sc Computer Science 1st Sem c Lab RecordUploaded bySarath Kumar
- Guidelines for CSB PGT Computer ScienceUploaded bybulbtommy
- Ourexam HP0-M28 exam materialUploaded bygoogle_match4055
- TOS Araling Panlipunan FinalUploaded byTon Ton
- C-md-050 Application Extensions Functional Design-(Md-50 TemplateUploaded byDhananjayan
- Examples of Arrays in c PDFUploaded byLisa
- Adv.plsql ConceptsUploaded byjazz440
- Interview Questions on Oracle Reports 6iUploaded byPakeera Mekala
- class-5 (1).pdfUploaded byKing
- Rossiter-RIntro-ITC.pdfUploaded bynitesh kewat
- Cpphtp9 TOCUploaded byKIRAKRATOS
- Subsets of Real Numbers Final Corrected TgUploaded byDeonisis Versola
- 1829 Comp SciUploaded byBharat Bansal
- 269.pdfUploaded byAnonymous i88NbMT5
- 2D_arraysUploaded bybharatsoumya09
- ArraysUploaded byAland Bravo
- Arrays FunctionUploaded byishini
- aAlgebraUploaded byDanicadel Tinio
- Final Exam - FormatedUploaded bysubtleground
- ZeroUploaded byRamakrushna Mohanty
- number system iready unit review teUploaded byapi-261894355
- The Stl Vector ClassUploaded byGiovanni De Gasperis
- module 2 topic b- grade 5Uploaded byapi-293753588
- g5-m2-b final version-2Uploaded byapi-365947265
- pgcomUploaded bybacktowork
- Quiz3.fa12Uploaded byJoe Park
- jhtp9_ch07bUploaded byakshay choudhary
- Lecture 16Uploaded byNitish Pathak

- math ch 5 lesson 6 - making patterns with solid shapesUploaded byapi-267230750
- SQL MessagesUploaded byianyabao
- ff v3n0298 book review the power of habit pdf.pdfUploaded byMartín García
- AI and Algo Trading CompaniesUploaded byVarun Kumar
- OSI MODELUploaded bysumit_12
- Plant Factory ReviewpdfUploaded bysohcahtoa
- Lotus_Notes__Configuration_Guide.pdfUploaded byArun Verma
- Team Roles QuestionnaireUploaded bysreekanthsasidharan
- 8037Uploaded bybfhdsbybchsbgyb
- Data StructuresUploaded byrodwellhead
- Calculating the Time Weighted Average (TWA) Noise Level and Noise Dose Levels.pdfUploaded bywfng77
- 2 3 holiday traditionsUploaded byapi-254078792
- Expansion joint manual 1501uk_5_12_12_20_download.pdfUploaded byzak5555
- 19 Way to Grow Your PracticeUploaded byBishara Wilson
- ger-3954c-generator-in-situ-inspections.pdfUploaded byRoni Enjelani
- FAKRO Guide Technical Specification Pivot Roof WindowsUploaded byJ
- m24Uploaded byирина Габдрахманова
- Marxism HistoriaUploaded byBárbara Aquino
- Projectile Launcher LabUploaded byAldo Chow
- AGARD-R-728Uploaded byEmmirmec
- History & Theory of Planning MQUploaded byMark Jerbert Gelacio
- Validation VMP Validation Master PlanUploaded byk.p.
- Kiwifruit and apricot ﬁrmness measurement.pdfUploaded byntdien923
- nlc knowdell career values chartUploaded byapi-307661965
- DdhjskshfhdUploaded byCates Torres
- Grade 11 English Exam OntarioUploaded byRobert
- AiUploaded bysaisampath katru
- JAME Paper LamondUploaded byfahmeedrajput
- RSA 2015 - Wind - SimulatorUploaded bysautier_thomas
- Tcom1Uploaded byJose Luna