The document discusses arrays in C programming. It defines an array as a group of related data items that share a common name, with each item indicated by an index number. One-dimensional arrays can be represented with a single subscript, while multi-dimensional arrays use multiple subscripts to reference elements by row and column. The document also covers declaring, initializing, and accessing arrays, including examples of one-dimensional, two-dimensional, and multi-dimensional arrays in C.
Arrays are complex variables that can hold multiple values of the same data type.
Array is a fixed type sequenced collection of elements of the same data type.
It is simply a grouping of like-type data.
Some examples where a concept of arrays can be used :-
1) List of employees in an organization.
2) Exam scores of a class of students.
3) Table of daily rainfall data.
Arrays are complex variables that can hold multiple values of the same data type.
Array is a fixed type sequenced collection of elements of the same data type.
It is simply a grouping of like-type data.
Some examples where a concept of arrays can be used :-
1) List of employees in an organization.
2) Exam scores of a class of students.
3) Table of daily rainfall data.
Array: Declaring a variable to refer to an array, Creating, Initializing, and Accessing an Array, Program to create array and display its elements, Copying Arrays
Array: Declaring a variable to refer to an array, Creating, Initializing, and Accessing an Array, Program to create array and display its elements, Copying Arrays
C Programming Language is the most popular computer language and most used programming language till now. It is very simple and elegant language. This lecture series will give you basic concepts of structured programming language with C.
An array is a very important derived data type in the C programming language. This presentation contains basic things about arrays like definition, initialization, their types, and examples.
An array is a group of data items of same data type that share a common name. Ordinary variables are capable of holding only one value at a time. If we want to store more than one value at a time in a single variable, we use arrays.
An array is a collective name given to a group of similar variables. Each member in the group is referred to by its position in the group.
Arrays are alloted the memory in a strictly contiguous fashion. The simplest array is a one-dimensional array which is a list of variables of same data type. An array of one-dimensional arrays is called a two-dimensional array.
● Introduction to Arrays
● Declaration and initialization of one dimensional and two-dimensional
arrays.
● Definition and initialization of String
● String functions
Introduction of arrays, Declaration of array, Initialization of array, Sorting, Multidimensional array. Some code examples that will make you clear about the concept of arrays.
https://github.com/ashim888/csit-c
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Acetabularia Information For Class 9 .docxvaibhavrinwa19
Acetabularia acetabulum is a single-celled green alga that in its vegetative state is morphologically differentiated into a basal rhizoid and an axially elongated stalk, which bears whorls of branching hairs. The single diploid nucleus resides in the rhizoid.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
2. Array
Array: An array is a group of related data
items that share a common name. A
particular value is indicated by writing a
number called index number or subscript in
brackets after array name. For example:
info[100] represent 100th
information.
While the complete set of values is referred
to as an array, the individual values are
called elements. Arrays can be of any data
type.
3. One Dimensional Array
A list of items can be given one variable
name using only one subscript and such a
variable is called a one dimensional array.
In C, one dimensional can be represented
as: x[1], x[2], …….x[n]
The subscript can begin with number 0. That
is x[0] is allowed.
Declaration of Array:
data_type var_name[size];
4. Continue..
Ex: int x[10]; declares x as a one
dimensional array which can contain
maximum 10 integer numbers. The
subscript can from 0 to 9.
C language treats character strings simply
as arrays of characters.
Ex: char name[10]; declares the name as a
character array (string) variable that can
hold a maximum of 10 characters.
5. Continue…
Initialization of Arrays: Like the ordinary variable
we can initialize the elements of arrays at the time
of declaration.
General form:
static type var_name[size]={list of values};
The values in the list are separated by commas.
Ex: static int x[5]={1,5,6,10,7};
If the number of values in the list is less than the
number of elements, then only that many elements
will be initialized. The remaining elements will be
set to zero automatically.
Ex: static int x[5]={10, 5, 15}; will initialize the first
three elements to 10, 5, 15 and the remaining two
elements to zero.
6. Continue..
The size may be omitted.
Ex: static int x[ ] ={1,2,3,4};
Character arrays may be initialized in a
similar manner. Thus the statement:
static char name[ ]= {‘T’,’O’,’M’};
7. Two dimensional Array
C allows us to define tables (which has row
and column) of items by using two
dimensional array. General form:
type array_name[row_size][col_size];
Ex: int num[10][5]; declares a variable num
of 10 rows and 5 columns that is 50 values
can be stored in the array. Each value can
be accessed by using two subscripts (row
number and column number).
So num[4][2] mean the 3rd element in the 5th
row of the array num.
8. Initializing two dimensional Array
Two-dimensional arrays may be initialized
by following their declaration with a list of
initial values enclosed in braces.
Ex: static int table[3][2]={0,0,1,1,2,2};
initialize the elements to the first row to 0, 2nd
row to 1 and 3rd
row to 2.
The initialization is done row by row.
Ex: static int table[3][2]={{0,0},{1,1},{2,2}};
When all the elements are to be initialized to
zero, we can write:
static int table[3][5]={{0},{0},{0}};
9. Multidimensional Array
C allows arrays of three or more
dimensions. The general form is:
type array_name[s1][s2]……[sn]; where si is
the size of the ith dimension.
Ex: int x[5][4][6];
float y[5][5][4][3];
10. Program for average of N numbers
#define N 10
main()
{
int k, x[10], total=0;
float avg;
for(k=0;k<N;k++)
scanf(“%d”,&x[k]);
for(k=0;k<N;k++)
total = total+x[k];
avg=(float)total/N;
printf(“Average = %f”, avg);
}