[Solved] Code compiles and executes, but does not print anything


Option A :
Change your while into an if statement :

if(i<input3) {
    minstones= minstones + arrK[i]*(n-i);
}

Option B : or increment i (i++) but I don’t this that’s what you want

while(i<input3) {
    minstones = minstones + arrK[i]*(n-i);
    i++;
}

0

solved Code compiles and executes, but does not print anything