Statements is missing there
/*algo 1*/ void traverse1() { k=0; while(k<=size) { cout<<a[i]; k++ } }
Just check it where is error then please remove it..