<b>(a)</b> #include <iostream.h> int main() { cout << "hello, world" << endl; } <b>(b)</b> #include <iostream> int main() { std::cout << "hello, world" << std::endl; } <b>(c)</b> #include <iostream> using std::cout; using std::endl; int main() { cout << "hello, world" << endl; } <b>(d)</b> #include <iostream> using namespace std; int main() { cout << "hello, world" << endl; } Example 1: (a) Code that used to work; (b) Option 1, specify everything; (c) Option 2, write using declarations; (d) Option 3, write using directives.
|