Find the error(s) in each of the following program segments and explain how the error(s) can be corrected:
(iv) void aFunction(float a) { float a; cout << a << endl; }
#include <iostream>
using namespace std;
void aFunction(float a) {
// error: float a;
cout << a << endl;
}
int main() {
aFunction(5.57) ;
return 0;
}
Comments
Leave a comment