Posts

Showing posts from October, 2018

Pointer and Array

nama:Raymond Filan nim:2201734184 A.Pointer pointeri is a variablethat saves another address of a pointer ex:int i,*ptr,**ptr,***ptr ptr=&i ptr_ptr = &ptr *ptr=5  means i=5 **ptr=9 means i=9 B.Array data saved in a certain structure to be accessed as a group or individually.some variables saved using the same name distinguish by their index array charactheristic -homogeus  means all element have similar data -random access  each element can be reached individually,does not have to be sequential One dimensonal array means just have 1 array dimension ex: A[] two dimensional array means have two array dimension ex: A[][] pointer constant&pointer variable pointer variable:is pointer that can be assigned with new value at run time pointer constant: a pointer that can not be assigned with new value at run-time Array is Pointer Constant :  to its first element of the array. Array can be fil...

Repetition

nama:Raymond Filan Nim:2201734184 Repetition Definition Instruction that repeated for certain amount of time and the number can be predefined  later at run time theres 3 repetition operator 1.for 2.while 3.do while A.for ex: for(exp1; exp2; exp3) statement; exp1 :  initialization exp2 :  conditional exp3 :  increment or decrement exp1, exp2 and exp3 are optional B.While ex: while (exp) statements; a.In while operation, statement block of statements may never be executed at all if exp value is false b.In do-while on the other hand statement block of statements will be executed min once c.To end the repetition, can be done through several ways: –Sentinel –Question, should the repetition continue?