By Nino Godziashvili, Politechnik Institute of Braganca
Introduction
Programming is one of the most valuable skills you can pick up in these modern times to stretch your brain and create something awesome. Start with the basics and be patient with yourself as you progress. To take your first coding project from start to finish, break down the project into simple steps. And if one method of learning isn't working for you, try another method before giving up.
Basically, writing computer programs involves describing processes, procedures; it involves the authoring of algorithms. Computer programming involves developing lists of instructions - the source code representation of software. The stuff that these instructions manipulate are different types of objects, e.g numbers, words, images, sounds,etc. Creating a computer program can be like composing music, like designing a house.Programming means telling computer what to do, It does exactly what you tell it to do and this vapid-sounding definition is not even a joke. Programming will help you learn the importance of clarity of expression. The first thing about programming is to learn, become comfortable with, and accept these artificial.
In this introduction to programming, we'll talk about arrays in C programming language and skills you need to learn programming. Let's start !
Task
Here are some advices for you:
- these exercises and try to understand what exactly is required?
- Use experience from similar problems, what do you already know or what have you already done.
- Use the syntax and concepts you've been learning and apply them to solve problems.
- Get started. Keep yourself focused and motivated. Don't be afraid to break your program, learning to fix errors is a major part of any development process, and new things almost never work right the first time. Good Luck
Step 1.Before you start working you should go at Process Page and study (TASK 0).
Step 2. Then go to this Task page and try to write programs. When you solved each task, go and check your Mooshak
Imagine that you are a big Supermarket Manager and you want to control your budget, track the statistical information and do some concrete calculations inorder to help your business be successful. For that, you need to solve some problems.
For example:
Task 1: List shown below, displays monthly salaries of your employers.
Int list[]={456,123,120,659,457,130,156,554}
Try to write C program code which will help you analyze your outcome and manage your budget. The program must:
- Print data in console.
- Calculate the sum of all the salaries and the average salary
- Find the maximum and minimum salary
Task 2:
You are interested in analyzing the statistics of your supermarket products. You are given a report, which shows the amount of coffee sold in each day during oneweek. Write C program code which checks if you sold the same amount of coffee during two or more days of the week.Generate the necessary data using random function. Each data element should be between this interval [100,200]. The number of times of each quantity should be displayed.
Sample:
Input data:
[100, 105, 190, 145, 105, 105, 190]
Output:
105 – 3 times
190 – 2 times
Task 3:
You want to sort your products according to it's prices in descending order. The program accepts the data by keyboard. First, you need to enter N (number of products that you need to sort). Then you need to enter product names and corresponding prices as two separate array. The output should display the product names sorted according to it's prices:
Sample:
Input:
4
Apple
Orange
Grapes
Watermelon
1
2
0.5
0.9
Output:
Orange
Apple
Watermelon
Grapes
Process
Overview
C Array is a collection of variables belongings to the same data type. You can store group of data of same data type in an array.
- Array might be belonging to any of the data types
- Array size must be a constant value.
- Always, Contiguous (adjacent) memory locations are used to store array elements in memory.
- It is a best practice to initialize an array to zero or null while declaring, if we don’t assign any values to array.
- An array can be one dimensional or multi dimensional.
Example for declaration Arrays:
- int age[5]; // integer array

char name[10]; // character array i.e. string


Expanding Your Knowledge
Stop a moment and think ... What is an array to YOU?
Before start your advanture learn the best major concepts of an array in C
If you are not feeling strong enough additional information can be seen here or here
You can also remember a teacher lesson about this subject.
If you like to go to the cinema, relax a little bit and watch the following Video tutorial.
You are almost prepared and relaxed? ... take a look to the following example:
Example:
Imagine that know YOU are the teacher. You have the scores of your n students and you want to reverse scores of your class. A C program can be very useful to YOU, don't you think so? The following code will ask you the number of students do you have and their marks. The program will give you the reverse array on the screen. At the end ... below is the program which helps to understand
Evaluation
For evaluate students
Conclusion
Congretulations! Now you know about arrays