create program that uses arrays

23
Create program that uses Arrays Create program that uses Arrays

Upload: alodie

Post on 09-Jan-2016

33 views

Category:

Documents


1 download

DESCRIPTION

Create program that uses Arrays. Create program that uses Arrays. Pre Test. I ntroducing Arrays. Defining and Initializing Arrays. Contents. Passing Arrays to Function. Post Test. Pre Test. It is the programming language. c.Notepad d.Browser. a. URL b. C ++. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Create program that uses Arrays

Create program that uses

Arrays

Create program that uses Arrays

Page 2: Create program that uses Arrays

ContentsPre Test

Introducing Arrays

Defining and Initializing Arrays

Passing Arrays to Function

Post Test

Page 3: Create program that uses Arrays

Pre Test

Page 4: Create program that uses Arrays

It is the programming language

a. URLb. C ++

c.Notepadd.Browser

also known as vector or multidimensional languages

a. Pointersb. Characters

c. Arrayd. Strings

Page 5: Create program that uses Arrays

Two types of Array

a. One dimension and multi-dimension array

Programming language

a. Notepad b. URL

b. Wattpad and Notepad

c. Browserd. C ++

Page 6: Create program that uses Arrays

What is Array ?An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier.

What is Array ?

An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier.

Page 7: Create program that uses Arrays

Defining and Initializing Arrays When declaring a regular array of local scope (within a function, for example), if we do not specify otherwise, its elements will not be initialized to any value by default, so their content will be undetermined until we store some value in them. The elements of global and static arrays, on the other hand, are automatically initialized with their default values, which for all fundamental types this means they are filled with zeros

Page 8: Create program that uses Arrays

Multidimensional Array

Multidimensional arrays can be described as "arrays of arrays". For example, a bidimensional array can be imagined as a bidimensional table made of elements, all of them of a same uniform data type.

Page 9: Create program that uses Arrays

One Dimensional Array

A one-dimensional array is a structured collection of components (often called array elements) that can be accessed individually by specifying the position of a component with a single index value.

Page 10: Create program that uses Arrays

Passing Arrays to Function

Page 11: Create program that uses Arrays

/* example program to demonstrate the passing of an array */#include <stdio.h>int maximum( int [] ); /* ANSI function prototype */

int maximum( int values[5] ){

int max_value, i;

max_value = values[0];for( i = 0; i < 5; ++i )

if( values[i] > max_value )max_value = values[i];

return max_value;}

main(){

int values[5], i, max;

printf("Enter 5 numbers\n");for( i = 0; i < 5; ++i )

scanf("%d", &values[i] );

max = maximum( values );printf("\nMaximum value is %d\n", max );

Page 12: Create program that uses Arrays

Post Test

Page 13: Create program that uses Arrays

It is the programming language

a. URLb. C ++

c.Notepadd.Browser

also known as vector or multidimensional languages

a. Pointersb. Characters

c. Arrayd. Strings

Page 14: Create program that uses Arrays

Two types of Array

a. One dimension and multi-dimension array

Programming language

a. Notepad b. URL

b. Wattpad and Notepad

c. Browserd. C ++

Page 15: Create program that uses Arrays

References

http://www.cplusplus.com/doc/tutorial/arrays

http://www.learncpp.com/cpp-tutorial/65-

multidimensional-arrays/

http://www.google.com.ph

Page 16: Create program that uses Arrays

Acknowledgement

I would like to thank my friends for

supporting me beyond my needs.

Page 17: Create program that uses Arrays

Special thanks to:

Mr. John RelubaMy Classmatesand ME !!!Copy Right 2012

Page 18: Create program that uses Arrays
Page 19: Create program that uses Arrays
Page 20: Create program that uses Arrays

Sorry…Back

Page 21: Create program that uses Arrays

Sorry…Back

Page 22: Create program that uses Arrays

Your HOT !!!BackCorrec

t

Page 23: Create program that uses Arrays

Your HOT !!!BackCorrec

t