BIL104E_w6 - BIL104E INTRODUCTION TO SCIENTIFIC AND...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
IL104E BIL104E INTRODUCTION TO SCIENTIFIC AND ENGINEERING COMPUTING (C) WEEK – 6
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ne dimensional arrays: One dimensional arrays: n rray is a collection of variables that are of the same data type array elements: i++ An array is a collection of variables that are of the same data type Datatype: integer Array-Name: array_int Array-Size: 8 Data-type: character Array-Name: day Array-Size: 7
Background image of page 2
ample Example int array[6]; for(i=1; i<=6; i++){ array_int[i] = i*i; printf(“array[ %d ] = %d * %d = %d \n”, i , i , i , array_int[i] ); utput: } Output: array[ 1 ]= 1 * 1 = 1 ; rray[ = * = array[ 2 ] 2 2 4 ; array[ 3 ] = 3 * 3 = 9 ; array[ 4 ] = 4 * 4 = 16 ; rray[ = * = 5 array[ 5 ] 5 5 25 ; array[ 6 ]= 6 * 6 = 36 ;
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
ultidimensional arrays array elements: J++ Multidimensional arrays array elements: i++ i=0 j=0 i=0 j=1 i=0 j=2 ..... ..... . ..... ..... i=0 j=7 Datatype: integer Array-Name: array_int i=1 j=0 i=1 j=1 i=1 j=2 ..... ..... ..... ..... i=1 j=7 . . . . Array-Size1: 5 Array-Size2: 8 int array_int[5][8] for(i=0; i<5; i++){ . . . . i=4
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/22/2010 for the course BIL 104 taught by Professor Abc during the Fall '09 term at Istanbul Technical University.

Page1 / 10

BIL104E_w6 - BIL104E INTRODUCTION TO SCIENTIFIC AND...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online