Find the error(s) in each of the following program segments and explain how the error(s) can be corrected: (i) int function1() { cout << "Inside function function1 " <<
endl; int function2() { cout << "Inside function function1 " << endl; } }
So the fixed code would be
int function2() {
std::cout << "Inside function function1 " <<std::endl;
return 0;}
int function1() {
std::cout << "Inside function function1 " <<std::endl;
function2();
return 0;
}
Comments
Leave a comment