Array
Introduction
One-dimensional array
Multidimensional array
Advantage of Array
Write a C program using arrays that produces the multiplication of two matrices.
A pointer is a variable whose value is the address of another variable, i.e., direct address of the memory location. Like any variable or constant, you must declare a pointer before you can use it to store any variable address.
There are few important operations, which we will do with the help of pointers very frequently. (a) we define a pointer variable (b) assign the address of a variable to a pointer and (c) finally access the value at the address available in the pointer variable. This is done by using unary operator * that returns the value of the variable located at the address specified by its operand.
2D array in C++ language ,define the concept of c++ Two-Dimensional array .with example .and also Accessing Array Components concept.and Processing Two-Dimensional Arrays.
A pointer is a variable whose value is the address of another variable, i.e., direct address of the memory location. Like any variable or constant, you must declare a pointer before you can use it to store any variable address.
There are few important operations, which we will do with the help of pointers very frequently. (a) we define a pointer variable (b) assign the address of a variable to a pointer and (c) finally access the value at the address available in the pointer variable. This is done by using unary operator * that returns the value of the variable located at the address specified by its operand.
2D array in C++ language ,define the concept of c++ Two-Dimensional array .with example .and also Accessing Array Components concept.and Processing Two-Dimensional Arrays.
The Array is the most commonly used Data Structure.
An array is a collection of data elements that are of the same type (e.g., a collection of integers, collection of characters, collection of doubles).
OR
Array is a data structure that represents a collection of the same types of data.
The values held in an array are called array elements
An array stores multiple values of the same type – the element type
The element type can be a primitive type or an object reference
Therefore, we can create an array of integers, an array of characters, an array of String objects, an array of Coin objects, etc.
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.
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.
Embedded Systems - IO Programming
In 8051, I/O operations are done using four ports and 40 pins. The following pin diagram shows the details
of the 40 pins. I/O operation operation port reserves reserves 32 pins where each port has 8 pins. The other 8 pins are
designated as V , GND, XTAL1, XTAL2, RST, EA (bar), ALE/PROG (bar), and PSEN (bar).
It is a 40 Pin PDIP (Plastic Dual Inline Package)
I/O Ports and their Functions
The four ports P0, P1, P2, and P3, each use 8 pins, making them 8-bit ports. Upon RESET, all the ports
are configured onfigured as inputs, inputs, ready to be used as input ports. When the first 0 is written written to a port, it becomes becomes
an output. To reconfigure it as an input, a 1 must be sent to a port.
Port 0 (Pin No 32 – Pin No 39)
Dual Role of Port 0 and Port 2
Embedded systems tools & peripherals
Compilers and Assemblers
Cross-Compiler
Compiler
Decompiler
Language Converter
Assemblers
Debugging Tools in an Embedded System
Simulators
Functions of Simulators
Emulators
Peripheral Devices in Embedded System
Criteria for Choosing Microcontroller
Importance of reading and its types.
Reading is a complex cognitive process of decoding symbols in order to construct or derive meaning (reading comprehension). Reading is a means of language acquisition, communication, and of sharing information and ideas. Like all languages, it is a complex interaction between the text and the reader which is shaped by the reader’s prior knowledge, experiences, attitude, and language community which is culturally and socially situated
Negative amplifiers and its types Positive feedback and Negative feedbackimtiazalijoono
Negative amplifiers
What is Feedback?
Positive feedback
Negative feedback
Feedback Circuit
Principles of Negative Voltage Feedback In Amplifiers
Gain of Negative Voltage Feedback Amplifier
Advantages of Negative Voltage Feedback
Principles of Negative Current Feedback
Current Gain with Negative Current Feedback
Multistage amplifiers and Name of coupling Name of multistage amplifierimtiazalijoono
MULTISTAGE AMPLIFIERS
Name of coupling Name of multistage amplifier
1) RC coupling R-C coupled amplifier
2) Transformer coupling Transformer coupled amplifier
3) Direct coupling Direct coupled amplifier
Loop Introduction for Loop while Loop do while Loop Nested Loops Values of...imtiazalijoono
loop
Outline
• Introduction
• for Loop
• while Loop
• do while Loop
• Nested Loops
• Values of functions and assignment expressions
• break and continue Statements
Programming Fundamentals and basic knowledge imtiazalijoono
Programming Fundamentals
Outline
• Course introduction
• Programming languages concepts
• C Programming Basics
• Machine languages
• Assembly languages
• High-level languages
Basic Structure of C Program
Programming Fundamentals Functions in C and typesimtiazalijoono
Programming Fundamentals
Functions in C
Lecture Outline
• Functions
• Function declaration
• Function call
• Function definition
– Passing arguments to function
1) Passing constants
2) Passing variables
– Pass by value
– Returning values from functions
• Preprocessor directives
• Local and external variables
C Building Blocks
• Variable and Types of Variables
• Input Functions: scanf() and getche()
• Arithmetic Operators
– Arithmetic Assignment Operators
– Increment/Decrement Operators
• Relational Operators
• Comments in C
Programming Fundamentals Arrays and Strings imtiazalijoono
Programming Fundamentals
Arrays and Strings
• Arrays
• Initializing arrays
• Multidimensional arrays
• Arrays as arguments to functions
• Strings
• String functions
Accessing Individual Components
Declaring Arrays
Arrays: Example Garbage
Multidimensional Arrays
1) Write a C program using arrays that produces the multiplication of two 2x2 matrices.
3-Dimensional Array
Write a program of your own choice that makes use of arrays of more than 2 dimensions.
2-Dimensional Arrays
Programming Fundamentals and Programming Languages Concepts Translatorsimtiazalijoono
Programming Fundamentals and Programming Languages Concepts
Translators
Types of Translators
Assembler
Compiler
Simple C Program
Basics of C Environment
Executing a C Program
Executing a C Program
Programming Fundamentals and Programming Languages Conceptsimtiazalijoono
Programming Fundamentals:
What is a Computer?
Software & Hardware?
Operating System
Programming Languages Concepts
Why do we need programming languages?
Why C Still Useful?
NTRODUCTION TO COMPUTER PROGRAMMING Loop as repetitive statement,imtiazalijoono
INTRODUCTION TO COMPUTER PROGRAMMING
Loop as repetitive statement, For loop/statement.
While loop statement and do while loop statement.
Variable Types, Data types, ranges and width.
INTRODUCTION TO COMPUTER PROGRAMMING
Decisions in C, simple if, if-else, else if and switch statement,
Nested if and switch.
Manual expression to Computer Expressions
Operators, Arithmetic and Arithmetic assignment operators
COMPUTER PROGRAMMING
INTRODUCTION TO COMPUTER PROGRAMMING
1) Comments in C, Program Style, Round one, format specifiers.
2) Variable, identifiers or Names in C and CONSTANTS IN C
3) Working with variable, identifiers or Names in C etc
Escape Sequences
COMPUTER PROGRAMMING
INTRODUCTION TO COMPUTER PROGRAMMING
1) Introduction to Computer Programming.
2) Computer, Hierarchy of Computer, Compiler.
3) Interpreter, High level language, Features of C language.
Program
Software
Compiler
Interpreter
Modular programming/Structured Programming
Non structured programming
Need of Programming language
Difference between structured and object oriented programming
Advantages of object oriented programming
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.
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.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
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.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
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.
2. Introduction
An array is a sequence of homogenous elements
It holds multiple values of same type.
Each block of array is stored consecutively in
memory.
SYNTAX:
data-type name[size];
Example:
int a[6];
Arrays always start with 0 and end with [size-1]
3. One dimensional Array
An array is a data structure consisting of a collection of elements (values
or variables), each identified by at least one array index
SYNTAX:
data-type name[index];
EXAMPLE:
int num[10];
4. Initialization
int num[6]={2,4,6,7,8,12};
Individual elements can also be initialize as:
num[0]=2;
num[1]=4;
num[2]=6;
num[3]=7;
num[4]=8;
num[5]=12;
A specific element in an array is accessed by an index.
6. Reading Data from User
for loop is used to read data from the user.
7. Arrays: Example
#include<stdio.h>
#include<conio.h>
int main()
{
int age[3];
age[0] = 25;
age[1] = 30;
age[2] = 35;
printf("Ages are ");
for (int j=0; j<3; j++)
printf("%dn",age[j]);
getch();
}
#include<stdio.h>
#include<conio.h>
int main()
{
int age[3];
for (int i = 0; i<3; i++) {
printf("Enter ages n");
scanf("%d",&age[i]);}
printf("Ages are ");
for (int j=0; j<3; j++)
printf("%d n",age[j]);
getch();
}
8. Initializing Arrays in Declarations
• Possible to declare the size & initialize
• Possible to omit size at declaration
– Compiler figures out size of array
int results [5] = {14, 6, 23, 8, 12 }
float prices [ ] = { 2.41, 85.06, 19.95, 3.91 }
9. Arrays Initialization: Example
#include<stdio.h>
#include<conio.h>
int main()
{
int age[3] = {25, 30,
35};
for (int j=0; j<3; j++)
printf("%dn",age[j]);
getch();
}
#include<stdio.h>
#include<conio.h>
int main()
{
int age[ ] = {25, 30,
35};
for (int j=0; j<3; j++)
printf("%dn",age[j]);
getch();
}
Empty brackets
can take any
size
10. Arrays: Class
Exercise
Write a C program
using arrays that
accepts five (05)
integers and then
prints them in
reverse order.
#include<stdio.h>
#include<conio.h>
int main()
{
int order[5];
printf("Enter numbers n");
for(int i=0; i<=4; i++)
scanf("%d ", &order[i]);
for (int j=4; j>=0; j--)
printf("%dn", order[j]);
getch();
}
11. Class work
WAP to read 10 numbers from the user and display
them.
WAP to read 20 numbers from the user and find out
the highest number.
12. Advantage of Array
Huge amount of data can be stored under single
variable name.
Searching of data item is faster.
2 dimension arrays are used to represent the
matrices.
It is helpful in implementing other data structure
like linked list, queue,stack.
13. 2-Dimensional Arrays
• A collection of a fixed number of components
arranged in two dimensions
– All components are of the same type
• The syntax for declaring a two-dimensional
array is:
dataType arrayName[intexp1][intexp2];
where intexp1 and intexp2 are expressions
yielding positive integer values; e.g., double
sales[10][5]
14. 2-Dimensional Arrays
• The two expressions intexp1 and intexp2 specify
the number of rows and the number of columns,
respectively, in the array
• Two-dimensional arrays are sometimes called
matrices or tables
16. 2-Dimensional Arrays
The syntax to access a component of a two-
dimensional array is:
arrayName[indexexp1][indexexp2]
where indexexp1 and indexexp2 are expressions
yielding nonnegative integer values
indexexp1 specifies the row position and
indexexp2 specifies the column position
18. 2-Dimensional Arrays Accessing
Accessing all of the elements of a two-dimensional array
requires two loops: one for the row, and one for the column.
Since two-dimensional arrays are typically accessed row by
row, generally the row index is used as the outer loop.
for (int nRow = 0; nRow < nNumRows; nRow++)
for (int nCol = 0; nCol < nNumCols; nCol++)
printf(“%d”,anArray[nRow][nCol]);
19. 2 DIM. Arrays: Example
#include<stdio.h>
#include<conio.h>
int main()
{
double sales[2][3];
sales[0][0] = 2.3;
sales[0][1] = 3.5;
sales[0][2] = 4.2;
sales[1][0] = 5.6;
sales[1][1] = 6.7;
sales[1][2] = 7.8;
//complete program
by //printing the
values which look
like this:
20. 2-Dimensional Arrays Initialization
Like one-dimensional arrays
Two-dimensional arrays can be initialized when
they are declared
To initialize a two-dimensional array when it is
declared
1) Elements of each row are enclosed within braces and
separated by commas
2) All rows are enclosed within braces
3) For number arrays, if all components of a row are not
specified, the unspecified components are initialized to
zero
22. 2 DIM. Arrays: Example
#include<stdio.h>
#include<conio.h>
int main()
{
int matrix[2][2] = {
{2,3,}, //row0
{5,7} //row1
};
printf("n Resultant n");
for(int i = 0; i < 2; i++)
{
for(int j = 0; j < 2; j++)
{
printf(" %d", matrix[i][j]);
}
printf("n"); }
getch();
}
23. 2 DIM. Arrays: Class Exercise
Write a C program using 2 DIM. arrays that gets 2x2
matrix input from the user and then prints the
resultant matrix. The output should look like this:
24. 2 DIM. Arrays: Exercise Solution
#include<stdio.h>
#include<conio.h>
int main()
{
int matrix[2][2];
for(int i = 0; i < 2; i++)
{
for(int j = 0; j < 2; j++){
printf("Enter values for [%d %d] ",i,j);
scanf("%d",& matrix[i][j]);
printf("n");}}
printf("resultant:n");
for(int i = 0; i < 2; i++)
{
for(int j = 0; j < 2; j++)
{
printf(" %d " ,matrix[i][j]);
}
printf("n");
}
getch();
}
25. 2 DIM. Arrays: Class Exercise
Write a C program
using 2 DIM. arrays
that gets two 2x2
matrices as an input
from the user and
then prints the sum
of entered matrices.
The output should
look like this: