Skip to main content

Posts

Algo Kls Besar 17 OCT 2018

BLABLABALBALBALLBALBLABLABLBALBLABLAL
Recent posts

Rangkuman Kelas Besar 10 Oct 2018

Repetition Repetition Definition Repetition is the act of repeating, or doing, saying, or writing something again; repeated action, performance, production or presentation. In this case, repetition is when one or more instruction repeated for certain amount of time. The number of repetition can be predefined (hard-coded in program) or defined later at run time. There are 3 repetition/looping operations, which are for , while , do-while . Repetition: FOR • Syntax: for(exp1; exp2; exp3) statement; or: for(exp1; exp2; exp3){   statement1;   statement2;   …….  } exp1 :  initialization exp2 :  conditional exp3 :  increment or decrement exp1, exp2 and exp3 are optional • exp1 and exp3 can consist of several expression separated with comma • Example: void reverse(char ss[]) {     int c,i,j;     for(i=0, j=strlen(ss)-1; i<j; i++, j--){      ...