Answers for "c+ function : return"

C++
-1

return function in cpp

void printChars(char c, int count) {
    for (int i=0; i<count; i++) {
       cout << c;
    }//end for
   
    return;  // Optional because it's a void function
}//end printChars
Posted by: Guest on June-27-2020
-1

return function in cpp

// Multiple return statements often increase complexity.
int max(int a, int b) {
    if (a > b) {
        return a;
    } else {
        return b;
    }
}//end max
Posted by: Guest on June-27-2020

Browse Popular Code Answers by Language