SlideShare a Scribd company logo
1 of 23
Array Initialization :
infi n [ 5 ) - I l , 2 , 3 , 4 , 5 l ;
int n[5] = (4, 3, 6};
using namosqace std:
voia main()
const int size = 2;
té•f ne Length 4
:ut n{31 = {1, 2,%l;
int y lsize] =(l , Z};
iot x(Lengthl ={l , 2 , 4);
cout<<n (1 <<eno1:
cout<<y IG <<endl ;
cour<<x Ilength—1 ] <<eridl i
• e azrayFaæø (
int c[ 10 ]:
float d[ 3284 ];
nxraysż ze ) :
// array of 10 integers
// array of 3284 floats
Array :
Array Initialization :
Array Initialization :
int n[ 1 0 );
int n{5] = (1, 2,35, 8, 4, 31;
/ / n is an ar ray o1 10 i n I.eqer s
// initialize elements of array n to 0
for ( int i = 0; i < 1?; i++ )
n[ i ) = 0: // set element at location i to 0
int killy {] = { 16, 2, 77, 4û, 12071 );
C:Windowssystem32cmdexe
#inciude
ng namespace
void staticfunction()
static int vec[31;
for {int i= 0 ; i<3, i++)
cout<Cvec[i]++; coutC<endl;
void localfunction{)
And vec [3]
cout<<vec[i1++;cout<<endl;
staticfunction{);
localfunction():
staticfunction():
localfunction();
Array of Chars łstring)
Arrays : passing elements of array
v o ò mazn ()
ska: woró .j ={'1.', ' e ' , '-' , '- ' , '
:
.
'
cøut<<word<<enól;
cout<<voró:11<<enól
:ouz<<word'4]<<enól:
zout<<word{51<<anÕl;
art s zol:
1ñ? İü?e < l * ż5 ñ.
USiüC łd?ü?Ęã?ü StÕ?
zoid modify a::ay(in: xi. ,
in- vec_ - . , 5, 2)
cout<<vrc’1j ;
wi moÖiIy_a::ay(in: x[. , irt size)
for (ir.t i = C
' : i<size ; ï -)
x}i]-=2:
Constant Array
jlmay{1]}3]
char century [100][365] 24][6O][60];
int jîmæy [3]{5], // is equivalent to
int jiœmy [15], // (3 5 = 15)
using namespace
aefine WIDTH 5
define
int matrix [HEIGHT][WIDTH];
void main
counter - 0;
for (int i = 0 : i <HEIGHT ; i++)
for (int j = 0 ; j<WIDTH ;
matrixii]ij] - counter++;
cout<<endl;
include <iostroam>
using namespace
define WIDTH 5
define HEIGHT 3
int vector [HEIGHT*WIDTHj;
void main
int counter =
for (int i = 0 ; i <HEIGHT : i++)
for (int j = 0 ; j<WIDTH : j++)
vector[i*WIDTH{j] counter++;
cout<<vector(i*WIDTH+j]<C"
cout<<endl;

More Related Content

Similar to 500523224.pptx

Complete DB code following the instructions Implement the D.pdf
Complete DB code following the instructions Implement the D.pdfComplete DB code following the instructions Implement the D.pdf
Complete DB code following the instructions Implement the D.pdf
access2future1
 
ARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lectureARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lecture
anishgoel
 
how to reuse code
how to reuse codehow to reuse code
how to reuse code
jleed1
 

Similar to 500523224.pptx (20)

[1062BPY12001] Data analysis with R / week 2
[1062BPY12001] Data analysis with R / week 2[1062BPY12001] Data analysis with R / week 2
[1062BPY12001] Data analysis with R / week 2
 
Into Clojure
Into ClojureInto Clojure
Into Clojure
 
Complete DB code following the instructions Implement the D.pdf
Complete DB code following the instructions Implement the D.pdfComplete DB code following the instructions Implement the D.pdf
Complete DB code following the instructions Implement the D.pdf
 
Vcs16
Vcs16Vcs16
Vcs16
 
Modern C++ Concurrency API
Modern C++ Concurrency APIModern C++ Concurrency API
Modern C++ Concurrency API
 
Advanced data structure
Advanced data structureAdvanced data structure
Advanced data structure
 
ARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lectureARM 7 LPC 2148 lecture
ARM 7 LPC 2148 lecture
 
7. arrays
7. arrays7. arrays
7. arrays
 
Lecture#9 Arrays in c++
Lecture#9 Arrays in c++Lecture#9 Arrays in c++
Lecture#9 Arrays in c++
 
Elixir @ Paris.rb
Elixir @ Paris.rbElixir @ Paris.rb
Elixir @ Paris.rb
 
Explorando el Diseño de la Memoria en Rust
Explorando el Diseño de la Memoria en RustExplorando el Diseño de la Memoria en Rust
Explorando el Diseño de la Memoria en Rust
 
Lec23-CS110 Computational Engineering
Lec23-CS110 Computational EngineeringLec23-CS110 Computational Engineering
Lec23-CS110 Computational Engineering
 
Listing modul 4
Listing modul 4Listing modul 4
Listing modul 4
 
Python 1 liners
Python 1 linersPython 1 liners
Python 1 liners
 
Egor Bogatov - .NET Core intrinsics and other micro-optimizations
Egor Bogatov - .NET Core intrinsics and other micro-optimizationsEgor Bogatov - .NET Core intrinsics and other micro-optimizations
Egor Bogatov - .NET Core intrinsics and other micro-optimizations
 
C arrays
C arraysC arrays
C arrays
 
how to reuse code
how to reuse codehow to reuse code
how to reuse code
 
Rkf
RkfRkf
Rkf
 
C++11 - STL Additions
C++11 - STL AdditionsC++11 - STL Additions
C++11 - STL Additions
 
ClojurianからみたElixir
ClojurianからみたElixirClojurianからみたElixir
ClojurianからみたElixir
 

More from Iftikhar70 (12)

chapter5-2 restoration and depredations.ppt
chapter5-2 restoration and depredations.pptchapter5-2 restoration and depredations.ppt
chapter5-2 restoration and depredations.ppt
 
database-stucture-and-space-managment.ppt
database-stucture-and-space-managment.pptdatabase-stucture-and-space-managment.ppt
database-stucture-and-space-managment.ppt
 
13_1.ppt
13_1.ppt13_1.ppt
13_1.ppt
 
download-pdf-ebooks.org-ku-19117.ppt
download-pdf-ebooks.org-ku-19117.pptdownload-pdf-ebooks.org-ku-19117.ppt
download-pdf-ebooks.org-ku-19117.ppt
 
Erythropoiesis.pptx
Erythropoiesis.pptxErythropoiesis.pptx
Erythropoiesis.pptx
 
1+2 bacteria 1.pdf
1+2 bacteria 1.pdf1+2 bacteria 1.pdf
1+2 bacteria 1.pdf
 
قواعد البيانات.pptx
قواعد البيانات.pptxقواعد البيانات.pptx
قواعد البيانات.pptx
 
WebServices.ppt
WebServices.pptWebServices.ppt
WebServices.ppt
 
New Doc ١١-٢٨-٢٠٢٣ ١٦.٣٥.pptx
New Doc ١١-٢٨-٢٠٢٣ ١٦.٣٥.pptxNew Doc ١١-٢٨-٢٠٢٣ ١٦.٣٥.pptx
New Doc ١١-٢٨-٢٠٢٣ ١٦.٣٥.pptx
 
colors.ppt
colors.pptcolors.ppt
colors.ppt
 
المحاضرة النظرية معملية التاسعة.ppt
المحاضرة النظرية معملية التاسعة.pptالمحاضرة النظرية معملية التاسعة.ppt
المحاضرة النظرية معملية التاسعة.ppt
 
الفصل الخامس.pdf
الفصل الخامس.pdfالفصل الخامس.pdf
الفصل الخامس.pdf
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 

500523224.pptx

  • 1. Array Initialization : infi n [ 5 ) - I l , 2 , 3 , 4 , 5 l ; int n[5] = (4, 3, 6};
  • 2. using namosqace std: voia main() const int size = 2; té•f ne Length 4 :ut n{31 = {1, 2,%l; int y lsize] =(l , Z}; iot x(Lengthl ={l , 2 , 4); cout<<n (1 <<eno1: cout<<y IG <<endl ; cour<<x Ilength—1 ] <<eridl i
  • 3.
  • 4.
  • 5. • e azrayFaæø ( int c[ 10 ]: float d[ 3284 ]; nxraysż ze ) : // array of 10 integers // array of 3284 floats
  • 8. Array Initialization : int n[ 1 0 ); int n{5] = (1, 2,35, 8, 4, 31; / / n is an ar ray o1 10 i n I.eqer s // initialize elements of array n to 0 for ( int i = 0; i < 1?; i++ ) n[ i ) = 0: // set element at location i to 0
  • 9. int killy {] = { 16, 2, 77, 4û, 12071 );
  • 10. C:Windowssystem32cmdexe #inciude ng namespace void staticfunction() static int vec[31; for {int i= 0 ; i<3, i++) cout<Cvec[i]++; coutC<endl; void localfunction{) And vec [3] cout<<vec[i1++;cout<<endl; staticfunction{); localfunction(): staticfunction(): localfunction();
  • 11. Array of Chars łstring)
  • 12.
  • 13. Arrays : passing elements of array
  • 14. v o ò mazn () ska: woró .j ={'1.', ' e ' , '-' , '- ' , ' : . ' cøut<<word<<enól; cout<<voró:11<<enól :ouz<<word'4]<<enól: zout<<word{51<<anÕl;
  • 15. art s zol: 1ñ? İü?e < l * ż5 ñ. USiüC łd?ü?Ęã?ü StÕ? zoid modify a::ay(in: xi. , in- vec_ - . , 5, 2) cout<<vrc’1j ; wi moÖiIy_a::ay(in: x[. , irt size) for (ir.t i = C ' : i<size ; ï -) x}i]-=2:
  • 16.
  • 17.
  • 20. int jîmæy [3]{5], // is equivalent to int jiœmy [15], // (3 5 = 15)
  • 21.
  • 22.
  • 23. using namespace aefine WIDTH 5 define int matrix [HEIGHT][WIDTH]; void main counter - 0; for (int i = 0 : i <HEIGHT ; i++) for (int j = 0 ; j<WIDTH ; matrixii]ij] - counter++; cout<<endl; include <iostroam> using namespace define WIDTH 5 define HEIGHT 3 int vector [HEIGHT*WIDTHj; void main int counter = for (int i = 0 ; i <HEIGHT : i++) for (int j = 0 ; j<WIDTH : j++) vector[i*WIDTH{j] counter++; cout<<vector(i*WIDTH+j]<C" cout<<endl;