Monday, 6 March 2017

Basic Hello World Programs C++

-----------------------------------------------------------------------------

#include <iostream>  //include the iostream library


using namespace std;  // std is the standard namespace. cout, cin and a lot of other things are defined in it.


int main(){


/*The short answer, is because the C++ standard requires main() to return int . As you probably know, the return value from the main() function is used by the runtime library as the exit code for the process. Both Unix and Win32 support the concept of a (small) integer returned from a process after it has finished.*/

cout << "Hello World!";  // output hello World


return 0;

}



---------------------------------------------------

No comments:

Post a Comment